diff --git a/data/cc/quiz/quiz-basic.yml b/data/cc/quiz/quiz-basic.yml new file mode 100644 index 00000000..8133df3a --- /dev/null +++ b/data/cc/quiz/quiz-basic.yml @@ -0,0 +1,17 @@ +--- +'Photography > Edit quickly and customize templates > A student or teacher discount': 'template single > Adobe Express' +'PDFs > Edit quickly and customize templates > Licenses and business features for teams': 'template single with PDF > Acrobat Pro' +'Video + Graphic design > Edit quickly and customize templates > Neither apply': 'template double > Adobe Express' +'Illustration + PDFs > Edit quickly and customize templates > Neither apply': 'template double with PDF > Acrobat Pro' +'Photography + Video + Graphic design > Edit quickly and customize templates > A student or teacher discount': 'template triple > Adobe Express' +'Photography + Illustration + PDFs > Edit quickly and customize templates > Neither apply': 'template triple with PDF > Acrobat Pro' + +'Photography > Take the time to control every detail > Get them sorted and organized > A student or teacher discount': 'flagship single > Lightroom' +'Video > Take the time to control every detail > Create, edit, and share on social > Licenses and business features for teams': 'flagship single > Premiere Pro' +'Photography + Illustration > Take the time to control every detail > Correct color and lighting like a pro > Paint, draw, or doodle like on paper > A student or teacher discount': 'flagship double > Lightroom,Photoshop' +'Graphic design + Illustration > Take the time to control every detail > Create layouts for magazines, books, or posters > Draw crisp lines and smooth curves > Licenses and business features for teams': 'flagship double > InDesign,Illustrator' +'Photography + Video + PDFs > Take the time to control every detail > Get them sorted and organized > Create, edit, and share on social > Create and export PDFs to Office > A student or teacher discount': 'flagship triple > Premiere Pro,Lightroom,Acrobat' + +'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 doouble > 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' diff --git a/features/cc/quiz.screenshots.spec.js b/features/cc/quiz.screenshots.spec.js new file mode 100644 index 00000000..6e54d29b --- /dev/null +++ b/features/cc/quiz.screenshots.spec.js @@ -0,0 +1,12 @@ +module.exports = { + name: 'Quiz Recommender Blocks', + features: [ + { + tcid: '0', + name: '@quiz screenshots', + path: '/cc-shared/uar/plan-recommender/', + tags: '@cc @uar-quiz-screenshots @uar-quiz-static', + data: 'data/cc/quiz/quiz-basic.yml', + }, + ], +}; diff --git a/tests/cc/quiz.screenshots.test.js b/tests/cc/quiz.screenshots.test.js new file mode 100644 index 00000000..bbab3e39 --- /dev/null +++ b/tests/cc/quiz.screenshots.test.js @@ -0,0 +1,65 @@ +/* eslint-disable no-await-in-loop */ +/* eslint-disable no-loop-func */ +/* 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/cc/quiz.screenshots.spec.js'); + +const { features } = QuizSpec; +const { WebUtil } = require('../../libs/webutil.js'); + +test.describe('Quiz flow test suite', () => { + // reset timeout because we use this to run all test data + test.setTimeout(10 * 60 * 1000); + for (const feature of features) { + test( + `${feature.name}, ${feature.tags}`, + async ({ page, baseURL }) => { + const quiz = new Quiz(page); + const quizOldPage = new QuizOldPage(page); + const url = `${baseURL}${feature.path}`; + console.info(url); + + // load test data from static files + const testdata = await WebUtil.loadTestData(`${feature.data}`); + + let keyNumber = 0; + + for (let key of Object.keys(testdata)) { + console.log(key); + let oldProduct = ''; + 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, true); + }); + + await test.step('Old: Check results on test page', async () => { + oldProduct = await quizOldPage.checkResultPage(testdata[key], key, keyNumber, true); + }); + + 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(`New: Select each answer on test page according to ${key}`, async () => { + await quiz.clickEachAnswer(url, key, keyNumber, 'new', true); + }); + + await test.step('New: Check results on test page', async () => { + newProduct = await quiz.checkResultPage(testdata[key], key, keyNumber, 'new', true); + }); + + // expect.soft(newProduct).toContain(oldProduct); + } + }, + ); + } +});