-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import studioSpec from './studio.spec.js'; | ||
import StudioSpec from './studio.spec.js'; | ||
import StudioPage from './studio.page.js'; | ||
import ims from '../libs/imslogin.js'; | ||
import take from '../libs/screenshot/take.js' | ||
|
||
const { features } = StudioSpec; | ||
const miloLibs = process.env.MILO_LIBS || ''; | ||
const folderPath = 'screenshots/studio'; | ||
|
||
let studio; | ||
const { features } = studioSpec; | ||
|
||
test.beforeEach(async ({ page, browserName }) => { | ||
test.beforeEach(async ({ page, browserName, baseURL }) => { | ||
Check failure on line 11 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:31:5 › M@S Studio feature test suite › @studio-direct-search
Check failure on line 11 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:31:5 › M@S Studio feature test suite › @studio-direct-search
Check failure on line 11 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:56:5 › M@S Studio feature test suite › @studio-search-field
Check failure on line 11 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:56:5 › M@S Studio feature test suite › @studio-search-field
Check failure on line 11 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:91:5 › M@S Studio feature test suite › @studio-edit-title
|
||
test.slow(); | ||
test.skip( | ||
browserName !== 'chromium', | ||
'Not supported to run on multiple browsers.', | ||
); | ||
studio = new StudioPage(page); | ||
features[0].url = `${baseURL}/studio.html`; | ||
await page.goto(features[0].url); | ||
await page.waitForURL('**/auth.services.adobe.com/en_US/index.html**/'); | ||
Check failure on line 20 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:31:5 › M@S Studio feature test suite › @studio-direct-search
Check failure on line 20 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:31:5 › M@S Studio feature test suite › @studio-direct-search
Check failure on line 20 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:56:5 › M@S Studio feature test suite › @studio-search-field
Check failure on line 20 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:56:5 › M@S Studio feature test suite › @studio-search-field
Check failure on line 20 in nala/studio/studio.test.js GitHub Actions / Running Nala E2E UI Tests (20.x)[mas-live-chromium] › studio/studio.test.js:91:5 › M@S Studio feature test suite › @studio-edit-title
|
||
await ims.fillOutSignInForm(features[0], page); | ||
await expect(async () => { | ||
const response = await page.request.get(features[0].url); | ||
expect(response.status()).toBe(200); | ||
}).toPass(); | ||
await page.waitForLoadState('domcontentloaded'); | ||
}); | ||
|
||
test.describe('M@S Studio feature test suite', () => { | ||
|
@@ -24,46 +32,92 @@ test.describe('M@S Studio feature test suite', () => { | |
page, | ||
baseURL, | ||
}) => { | ||
const name = `${features[0].name}`; | ||
const name = `${features[0].name}`; | ||
|
||
test.slow(); | ||
const { data } = features[0]; | ||
const testPage = `${baseURL}${features[0].path}${miloLibs}${features[0].browserParams}${data.cardid}`; | ||
console.info('[Test Page]: ', testPage); | ||
|
||
await test.step('step-1: Log in to MAS studio', async () => { | ||
await test.step('step-1: Go to MAS Studio test page', async () => { | ||
await page.goto(testPage); | ||
page.waitForTimeout(5000); | ||
const result = await take.take( | ||
page, | ||
folderPath, | ||
name, | ||
); | ||
// writeResultsToFile(folderPath, testInfo, result); | ||
|
||
await page.waitForURL( | ||
'**/auth.services.adobe.com/en_US/index.html**/', | ||
); | ||
features[0].url = | ||
`${baseURL}/studio.html`; | ||
await ims.fillOutSignInForm(features[0], page); | ||
await expect(async () => { | ||
const response = await page.request.get(features[0].url); | ||
expect(response.status()).toBe(200); | ||
}).toPass(); | ||
await page.waitForLoadState('domcontentloaded'); | ||
}); | ||
|
||
await test.step('step-2: Go to MAS Studio test page', async () => { | ||
await test.step('step-2: Validate search results', async () => { | ||
await expect(await studio.renderView).toBeVisible(); | ||
|
||
const cards = await studio.renderView.locator('merch-card'); | ||
expect(await cards.count()).toBe(1); | ||
}); | ||
}); | ||
|
||
// @studio-search-field - Validate search field in mas studio | ||
test(`${features[1].name},${features[1].tags}`, async ({ | ||
page, | ||
baseURL, | ||
}) => { | ||
const name = `${features[0].name}`; | ||
|
||
test.slow(); | ||
const { data } = features[1]; | ||
const testPage = `${baseURL}${features[1].path}${miloLibs}${features[1].browserParams}`; | ||
console.info('[Test Page]: ', testPage); | ||
|
||
await test.step('step-1: Go to MAS Studio test page', async () => { | ||
await page.goto(testPage); | ||
await page.waitForLoadState('domcontentloaded'); | ||
}); | ||
|
||
await test.step('step-3: Validate search results', async () => { | ||
await test.step('step-2: Validate search field rendered', async () => { | ||
await expect(await studio.searchInput).toBeVisible(); | ||
await expect(await studio.searchIcon).toBeVisible(); | ||
await expect(await studio.renderView).toBeVisible(); | ||
|
||
const cards = await studio.renderView.locator('merch-card'); | ||
expect(await cards.count()).toBe(1); | ||
expect(await cards.count()).toBeGreaterThan(1); | ||
}); | ||
|
||
await test.step('step-3: Validate search feature', async () => { | ||
await studio.searchInput.fill(data.cardid); | ||
await page.keyboard.press('Enter'); | ||
await page.waitForTimeout(2000); | ||
expect(await studio.getCard(data.cardid, 'suggested')).toBeVisible; | ||
const searchResult = await studio.renderView.locator('merch-card'); | ||
expect(await searchResult.count()).toBe(1); | ||
}); | ||
}); | ||
|
||
// @studio-edit-title - Validate edit title feature in mas studio | ||
test(`${features[2].name},${features[2].tags}`, async ({ | ||
page, | ||
baseURL, | ||
}) => { | ||
const name = `${features[2].name}`; | ||
|
||
test.slow(); | ||
const { data } = features[2]; | ||
const testPage = `${baseURL}${features[2].path}${miloLibs}${features[2].browserParams}${data.cardid}`; | ||
console.info('[Test Page]: ', testPage); | ||
|
||
await test.step('step-1: Go to MAS Studio test page', async () => { | ||
await page.goto(testPage); | ||
await page.waitForLoadState('domcontentloaded'); | ||
}); | ||
|
||
await test.step('step-2: Open card editor', async () => { | ||
expect(await studio.getCard(data.cardid, 'suggested')).toBeVisible; | ||
await (await studio.getCard(data.cardid, 'suggested')).dblclick(); | ||
expect(await studio.editorPanel).toBeVisible; | ||
}); | ||
await test.step('step-2: Open card editor', async () => { | ||
expect(await studio.editorPanel.title).toBeVisible; | ||
await expect( | ||
await studio.editorPanel.locator(studio.editorTitle), | ||
).toHaveAttribute('value', `${data.title}`); | ||
await studio.editorPanel | ||
.locator(studio.editorTitle) | ||
.locator('input') | ||
.fill(data.newTitle); | ||
}); | ||
}); | ||
}); |