-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CC regression - accordion feature (#334)
* CC Merchtable block automation CC Merchtable block automation (JIra: MWPW-140978) * CC sticky promo bar, promo with close action automated test cases CC sticky promo bar, promo with close action automated test cases Jira : MWPW-140982, MWPW-142252 * CC Regression automated cases for media rounded corners, breadcrumb features CC Regression automated cases for media rounded corners, breadcrumb features (MWPW-140976, MWPW-142543) * Update roundedcorners-mediablock.test.js * CC home page tabs, fragment reference , merch pod AU tests CC home page tabs, fragment reference , merch pod AU tests Jiras: https://jira.corp.adobe.com/browse/MWPW-143230 https://jira.corp.adobe.com/browse/MWPW-142599 https://jira.corp.adobe.com/browse/MWPW-143231 * CC , CCT product pages sanity checks automation for EN Key CC , CCT product pages sanity checks automation for EN https://jira.corp.adobe.com/browse/MWPW-146289 * CC Tier1 locales production sanity tests CC Tier1 locales production sanity tests https://jira.corp.adobe.com/browse/MWPW-146289 * Update productionsanity.spec.js removed the lengthy URL * Update productionsanity.page.js removed the space * Update productionsanity.test.js removed tailing spaces from given lines * CC page Accordion features regression automated cases CC page Accordion features regression automated cases https://jira.corp.adobe.com/browse/MWPW-147151 https://jira.corp.adobe.com/browse/MWPW-147152 https://jira.corp.adobe.com/browse/MWPW-147153 https://jira.corp.adobe.com/browse/MWPW-147154 * Update accordion.test.js corrected the typo * Update accordion.test.js fixed indentations issue at line 14,15,16 Also removed wait from line number 81 --------- Co-authored-by: Aaron Mauchley <[email protected]>
- Loading branch information
1 parent
8a6f522
commit a0b6b56
Showing
3 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
name: 'accordion', | ||
features: [ | ||
{ | ||
tcid: '0', | ||
name: '@accordion-display', | ||
path: '/drafts/Automation-PW/accordion-faqs?georouting=off', | ||
tags: '@cc @cc-accordion @cc-accordionUI', | ||
}, | ||
{ | ||
tcid: '1', | ||
name: '@accordion-questionexpand', | ||
path: '/drafts/Automation-PW/accordion-faqs?georouting=off', | ||
tags: '@cc @cc-accordion @cc-accordionexpandfeature', | ||
}, | ||
{ | ||
tcid: '2', | ||
name: '@accordion-questioncollapse', | ||
path: '/drafts/Automation-PW/accordion-faqs?georouting=off', | ||
tags: '@cc @cc-accordion @cc-accordioncollapsefeature', | ||
}, | ||
{ | ||
tcid: '3', | ||
name: '@accordion-innterlinks', | ||
path: '/drafts/Automation-PW/accordion-faqs?georouting=off', | ||
tags: '@cc @cc-accordion @cc-accordionlinkscheck', | ||
url: 'https://www.adobe.com/creativecloud/plans.html', | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default class accordion { | ||
constructor(page) { | ||
this.page = page; | ||
// Accordion UI elements in page | ||
this.accordionSection = page.locator('.accordion-container.seo.static-links.con-block.max-width-10-desktop'); | ||
this.accordionName = this.accordionSection.locator('#accordion-1'); | ||
this.accordionQuestion1 = this.accordionName.locator('//dt[@role="heading"]').nth(0); | ||
this.accordionDefinition1 = this.accordionName.locator('#accordion-1-trigger-1'); | ||
this.accordionQuestion2 = this.accordionName.locator('//dt[@role="heading"]').nth(1); | ||
this.accordionDefinition2 = this.accordionName.locator('#accordion-1-trigger-2'); | ||
this.DefaultState = this.accordionName.locator('//button[@id="accordion-1-trigger-1" and @aria-expanded="false"]'); | ||
this.accordexpanded = this.accordionName.locator('//button[@id="accordion-1-trigger-1" and @aria-expanded="true"]'); | ||
this.firstQuestionLink = page.locator('//a[@daa-ll="Learn more about the-2--What is Adobe Creati"]'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { features } from '../../features/cc/accordion.spec.js'; | ||
import Accordion from '../../selectors/cc/accordion.page.js'; | ||
|
||
let accordion; | ||
test.describe('verify accordion showing up with authored question and answers with expand/collapse features', () => { | ||
test.beforeEach(async ({ page }) => { | ||
accordion = new Accordion(page); | ||
}); | ||
// Verify accordion showing up with authored question and answers and UI | ||
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { | ||
console.info(`[Test Page]: ${baseURL}${features[0].path}`); | ||
await test.step('accordion UI', async () => { | ||
await page.goto(`${baseURL}${features[0].path}`); | ||
await page.waitForLoadState('domcontentloaded'); | ||
await expect(page).toHaveURL(`${baseURL}${features[0].path}`); | ||
}); | ||
await test.step('accordion ui with expected elements', async () => { | ||
await page.waitForLoadState(); | ||
expect(await accordion.accordionSection).toBeTruthy(); | ||
expect(await accordion.accordionName).toBeTruthy(); | ||
expect(await accordion.accordionQuestion1).toBeTruthy(); | ||
expect(await accordion.accordionDefinition1).toBeTruthy(); | ||
expect(await accordion.accordionQuestion2).toBeTruthy(); | ||
expect(await accordion.accordionDefinition2).toBeTruthy(); | ||
expect(await accordion.DefaultState).toBeTruthy(); | ||
}); | ||
}); | ||
// check the expand feature when click on first question | ||
test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { | ||
console.info(`[Test Page]: ${baseURL}${features[1].path}`); | ||
await test.step('accordion expand on first question click', async () => { | ||
await page.goto(`${baseURL}${features[1].path}`); | ||
await page.waitForLoadState('domcontentloaded'); | ||
await expect(page).toHaveURL(`${baseURL}${features[1].path}`); | ||
}); | ||
await test.step('accordion expand when first question clicked', async () => { | ||
await page.waitForLoadState(); | ||
expect(await accordion.accordionName).toBeTruthy(); | ||
expect(await accordion.accordionQuestion1).toBeTruthy(); | ||
expect(await accordion.accordionDefinition1).toBeTruthy(); | ||
await accordion.accordionQuestion1.click(); | ||
expect(await accordion.accordexpanded).toBeTruthy(); | ||
}); | ||
}); | ||
// check the collapse feature when click on first question | ||
test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { | ||
console.info(`[Test Page]: ${baseURL}${features[2].path}`); | ||
await test.step('accordion collapse on first question click', async () => { | ||
await page.goto(`${baseURL}${features[2].path}`); | ||
await page.waitForLoadState('domcontentloaded'); | ||
await expect(page).toHaveURL(`${baseURL}${features[2].path}`); | ||
}); | ||
await test.step('accordion collapse when first question in expanded form', async () => { | ||
await page.waitForLoadState(); | ||
expect(await accordion.accordionName).toBeTruthy(); | ||
expect(await accordion.accordionQuestion1).toBeTruthy(); | ||
expect(await accordion.accordionDefinition1).toBeTruthy(); | ||
await accordion.accordionQuestion1.click(); | ||
expect(await accordion.accordexpanded).toBeTruthy(); | ||
await accordion.accordionQuestion1.click(); | ||
expect(await accordion.DefaultState).toBeTruthy(); | ||
}); | ||
}); | ||
// check the links are functional in the question summary | ||
test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { | ||
console.info(`[Test Page]: ${baseURL}${features[3].path}`); | ||
const { url } = features[3]; | ||
await test.step('links are functional in the question summary', async () => { | ||
await page.goto(`${baseURL}${features[3].path}`); | ||
await page.waitForLoadState('domcontentloaded'); | ||
await expect(page).toHaveURL(`${baseURL}${features[3].path}`); | ||
}); | ||
await test.step('links are functional in the given answers', async () => { | ||
await page.waitForLoadState(); | ||
expect(await accordion.accordionQuestion1).toBeTruthy(); | ||
expect(await accordion.accordionDefinition1).toBeTruthy(); | ||
await accordion.accordionQuestion1.click(); | ||
expect(await accordion.accordexpanded).toBeTruthy(); | ||
await accordion.firstQuestionLink.click(); | ||
await expect(page).toHaveURL(url); | ||
}); | ||
}); | ||
}); |