Skip to content

Commit

Permalink
Fix test failures for Mile Stage (#280)
Browse files Browse the repository at this point in the history
* add test for quiz and result pages

* add test for quiz and result pages

* add test for quiz and result pages

* add POC for analytics test

* update analytics tests and envs

* result envs

* update analytics only on firefox

* add dynamic tests

* add dynamic test for quiz page

* update quiz test

* update test structure

* add test for quiz and result pages

* add POC for analytics test

* update analytics tests and envs

* result envs

* update analytics only on firefox

* add dynamic tests

* add dynamic test for quiz page

* update quiz test

* update test structure

* update uar tests to new format

* update uar tests

* move everything to uar folder

* add dependency for js-yaml

* update test according to latest comments

* update test according to latest comments

* update tests according to the latest comments

* add uar config

* add analytics for uar

* update according to feedbacks

* update tags

* add @cc tag

* update according to feedbacks

* add dynamic tests for uar

* update according to review comments

* fix some typos

* update according to review comments

* merge console log info

* add UI screenshots for UAR

* move view point to test

* update according to feedback

* add analytics test for UAR

* update validation and uar libs

* update libs

* update by feedback

* update some config and tests

* update some config and tests

* update test content path to common path

* update analytics tests

* fix test failures caused by test code

* fix test failures

* fix test failures

* add visual test for CAAS with two pages

* update according to feedbacks

* update report in config file

* add screenshot for milo main live vs uar-integration live

* add timestamp js for time stampe recording

* add screenshot diff for uar stable and beta

* move uar screenshots into visual compare folder

* add UI screenshots for DX Quiz

* build a function to get screenshots

* update locator

* udate uar to only run basic tests

* update according to feedback

* add screenshot for UAR in CC which will go live

* update final path for UAR in CC

* update the final CC path

* update cc uar screenshots to hlx.live vs stage

* update test

* update screenshot test

* update uar analytics to run on STAGE

* update tests to run on different envs after go live

* Fix test failures for MWPW-143444

* update urls

---------

Co-authored-by: xiasun <[email protected]>
Co-authored-by: Aaron Mauchley <[email protected]>
Co-authored-by: xiasun <[email protected]>
  • Loading branch information
4 people authored Mar 2, 2024
1 parent 7ca9dbc commit e032c18
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 34 deletions.
7 changes: 7 additions & 0 deletions configs/uar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ const config = {
baseURL: envs['@adobe_stage'],
},
},
{
name: 'milo-stage-firefox',
use: {
...devices['Desktop Firefox'],
baseURL: envs['@milo_stage'],
},
},
],
};
module.exports = config;
1 change: 0 additions & 1 deletion data/uar/quiz/quiz-basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@

'3D/AR > Assemble, stage, and render 3D scenes > Neither apply': '3D single > Substance 3D Stager'
'Photography + 3D/AR > Get them sorted and organized > Create 3D models with digital clay > A student or teacher discount': '3D double > Lightroom,Substance 3D Modeler'
'Photography + Video + 3D/AR > Get them sorted and organized > Create, edit, and share on social > Texture 3D assets in real time > Licenses and business features for teams': '3D triple > Lightroom,Premiere Pro,Substance 3D Painter'
1 change: 1 addition & 0 deletions envs/envs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
'@milo_live': 'https://main--milo--adobecom.hlx.live',
'@milo_prod': 'https://milo.adobe.com',
'@milo_stage': 'https://stage--milo--adobecom.hlx.live',
'@feds_live': 'https://gnav--milo--adobecom.hlx.live',
'@stock_live': 'https://main--stock--adobecom.hlx.live',
'@adobestock_live': 'https://main--adobestock--adobecom.hlx.live',
Expand Down
15 changes: 3 additions & 12 deletions tests/uar/quiz.dynamic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
/* eslint-disable no-restricted-syntax */
import { expect, test } from '@playwright/test';
import { buildTestData } from '../../data/uar/quiz/uar.js';
import QuizOldPage from '../../selectors/uar/quiz.old.page.js';
import Quiz from '../../selectors/uar/quiz.page.js';

const QuizSpec = require('../../features/uar/quiz.dynamic.spec.js');

const { features } = QuizSpec;
const { WebUtil } = require('../../libs/webutil.js');
const envs = require('../../envs/envs.js');

test.describe('Quiz flow test suite', () => {
// reset timeout because we use this to run all test data
Expand All @@ -30,22 +30,13 @@ test.describe('Quiz flow test suite', () => {
testdata = testdata.sort(() => 0.5 - Math.random()).slice(0, 20);
}

for (let key of testdata) {
for (const key of testdata) {
console.log(key);
let oldProduct = '';
let newProduct = '';

if (key.includes('PDFs > Edit quickly')) {
// eslint-disable-next-line no-continue
continue;
}

if (key.includes('PDFs > Take the time to control')) {
key = key.replace('PDFs > Take the time to control every detail', 'PDFs');
}

await test.step(`Old: Select each answer on test page according to ${key}`, async () => {
await quizOldPage.clickEachAnswer('https://www.stage.adobe.com/creativecloud/plan-recommender/quiz.html', key);
await quizOldPage.clickEachAnswer(`${envs['@milo_stage']}${feature.path}`, key);
});

await test.step('Old: Check results on test page', async () => {
Expand Down
27 changes: 9 additions & 18 deletions tests/uar/quiz.screenshots.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
/* eslint-disable no-restricted-syntax */
import { expect, test } from '@playwright/test';
import Quiz from '../../selectors/uar/quiz.page.js';
import QuizOldPage from '../../selectors/uar/quiz.old.page.js';

const QuizSpec = require('../../features/uar/quiz.screenshots.spec.js');

const { features } = QuizSpec;
const { WebUtil } = require('../../libs/webutil.js');
const envs = require('../../envs/envs.js');

test.describe('Quiz flow test suite', () => {
// reset timeout because we use this to run all test data
Expand All @@ -33,32 +33,23 @@ test.describe('Quiz flow test suite', () => {
let newProduct = '';
keyNumber += 1;

if (key.includes('PDFs > Edit quickly')) {
// eslint-disable-next-line no-continue
continue;
}

if (key.includes('PDFs > Take the time to control')) {
key = key.replace('PDFs > Take the time to control every detail', 'PDFs');
}

await test.step(`Prod: Select each answer on test page according to ${key}`, async () => {
await quizOldPage.clickEachAnswer('https://www.adobe.com/creativecloud/plan-recommender/quiz.html', key, keyNumber, 'prod', true);
await test.step(`Stage: Select each answer on test page according to ${key}`, async () => {
await quizOldPage.clickEachAnswer(`${envs['@milo_stage']}${feature.path}`, key, keyNumber, 'stage', true);
});

await test.step('Prod: Check results on test page', async () => {
oldProduct = await quizOldPage.checkResultPage(testdata[key], key, keyNumber, true);
await test.step('Stage: Check results on test page', async () => {
oldProduct = await quizOldPage.checkResultPage(testdata[key], key, keyNumber, 'stage', true);
});

await test.step(`Stage: Select each answer on test page according to ${key}`, async () => {
await quiz.clickEachAnswer('https://www.stage.adobe.com/creativecloud/plan-recommender/quiz.html', key, keyNumber, 'stage', true);
await test.step(`New: Select each answer on test page according to ${key}`, async () => {
await quiz.clickEachAnswer(url, key, keyNumber, 'new', true);
});

await test.step('Stage: Check results on test page', async () => {
await test.step('New: Check results on test page', async () => {
newProduct = await quiz.checkResultPage(testdata[key], key, keyNumber, 'new', true);
});

// expect.soft(oldProduct).toContain(newProduct);
expect.soft(oldProduct).toContain(newProduct);
}
},
);
Expand Down
6 changes: 3 additions & 3 deletions tests/uar/quiz.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
/* eslint-disable no-restricted-syntax */
import { expect, test } from '@playwright/test';
import Quiz from '../../selectors/uar/quiz.page.js';
import QuizOldPage from '../../selectors/uar/quiz.old.page.js';

const QuizSpec = require('../../features/uar/quiz.spec.js');

const { features } = QuizSpec;
const { WebUtil } = require('../../libs/webutil.js');
const envs = require('../../envs/envs.js');

test.describe('Quiz flow test suite', () => {
// reset timeout because we use this to run all test data
Expand All @@ -18,7 +18,7 @@ test.describe('Quiz flow test suite', () => {
`${feature.name}, ${feature.tags}`,
async ({ page, baseURL }) => {
const quiz = new Quiz(page);
const quizOldPage = new QuizOldPage(page);
const quizOldPage = new Quiz(page);
const url = `${baseURL}${feature.path}`;
console.info(url);

Expand All @@ -33,7 +33,7 @@ test.describe('Quiz flow test suite', () => {
let newProduct = '';
keyNumber += 1;
await test.step(`Old: Select each answer on test page according to ${key}`, async () => {
await quizOldPage.clickEachAnswer('https://www.adobe.com/creativecloud/quiz-recommender.html', key, keyNumber, false);
await quizOldPage.clickEachAnswer(`${envs['@milo_stage']}${feature.path}`, key, keyNumber, false);
});

await test.step('Old: Check results on test page', async () => {
Expand Down

0 comments on commit e032c18

Please sign in to comment.