Skip to content

Commit

Permalink
chrome single test
Browse files Browse the repository at this point in the history
  • Loading branch information
3ch023 committed Dec 23, 2024
1 parent 8201c47 commit f0dcd19
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 57 deletions.
112 changes: 56 additions & 56 deletions nala/studio/studio.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,66 +50,66 @@ test.describe('M@S Studio feature test suite', () => {
});
});

// @studio-search-field - Validate search field in mas studio
test(`${features[1].name},${features[1].tags}`, async ({
page,
baseURL,
}) => {
const { data } = features[1];
const testPage = `${baseURL}${features[1].path}${miloLibs}${features[1].browserParams}`;
console.info('[Test Page]: ', testPage);
// // @studio-search-field - Validate search field in mas studio
// test(`${features[1].name},${features[1].tags}`, async ({
// page,
// baseURL,
// }) => {
// 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-1: Go to MAS Studio test page', async () => {
// await page.goto(testPage);
// await page.waitForLoadState('domcontentloaded');
// });

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()).toBeGreaterThan(1);
});
// 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()).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);
});
});
// 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 { data } = features[2];
const testPage = `${baseURL}${features[2].path}${miloLibs}${features[2].browserParams}${data.cardid}`;
console.info('[Test Page]: ', testPage);
// // @studio-edit-title - Validate edit title feature in mas studio
// test(`${features[2].name},${features[2].tags}`, async ({
// page,
// baseURL,
// }) => {
// 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-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-3: Edit title field', 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);
});
});
// 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-3: Edit title field', 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);
// });
// });
});
3 changes: 2 additions & 1 deletion nala/utils/pr.run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ npx playwright install --with-deps
# Run Playwright tests on the specific projects using root-level playwright.config.js
# This will be changed later
echo "*** Running tests on specific projects ***"
npx playwright test --config=./playwright.config.js ${TAGS} ${EXCLUDE_TAGS} --project=mas-live-chromium --project=mas-live-firefox ${REPORTER} || EXIT_STATUS=$?
npx playwright test --config=./playwright.config.js ${TAGS} ${EXCLUDE_TAGS} --project=mas-live-chromium ${REPORTER} || EXIT_STATUS=$?
#npx playwright test --config=./playwright.config.js ${TAGS} ${EXCLUDE_TAGS} --ui --project=mas-live-chromium ${REPORTER} || EXIT_STATUS=$?

# Check if tests passed or failed
if [ $EXIT_STATUS -ne 0 ]; then
Expand Down

0 comments on commit f0dcd19

Please sign in to comment.