-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
* NALA tests for CAAS * selector * updated test * fixing linting errors * more linting errors * fix linting 3 * fix linting 4 * fix linting 5 * fixed spacing issue --------- Co-authored-by: Gayane Mirijanyan <[email protected]> Co-authored-by: Gayane Mirijanyan <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
FeatureName: 'CAAS Feature', | ||
features: [ | ||
{ | ||
tcid: '0', | ||
name: '@Card Collection', | ||
path: '/drafts/nala/features/caas/caascollection', | ||
data: { | ||
cardsPerPage: 4, | ||
caasTitle: 'Consonant Card Collection Title', | ||
paginator: '1 - 4 of 8 results', | ||
}, | ||
tags: '@caas @smoke @regression @milo', | ||
}, | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export default class Caas { | ||
constructor(page) { | ||
this.page = page; | ||
|
||
// caas locators | ||
this.caasCards = this.page.locator('.consonant-Card'); | ||
this.caasTitle = this.page.locator('.consonant-FiltersInfo-title'); | ||
this.caasPaginator = this.page.locator('.consonant-Pagination-summary'); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { features } from '../../features/milo/caas.spec.js'; | ||
import Caas from '../../selectors/milo/caas.feature.page.js'; | ||
|
||
let caas; | ||
let consoleErrors = []; | ||
|
||
test.describe('Milo CAAS Feature test suite', () => { | ||
test.beforeEach(async ({ page }) => { | ||
caas = new Caas(page); | ||
|
||
page.on('console', (exception) => { | ||
if (exception.type() === 'error') { | ||
consoleErrors.push(exception.text()); | ||
} | ||
}); | ||
}); | ||
|
||
test.afterEach(async () => { | ||
consoleErrors = []; | ||
}); | ||
|
||
// Test 0 : Card Collection | ||
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { | ||
console.info(`[Test Page]: ${baseURL}${features[0].path}`); | ||
const { data } = features[0]; | ||
|
||
await test.step('step-1: Go to CAAS collection test page', async () => { | ||
await page.goto(`${baseURL}${features[0].path}`); | ||
await page.waitForLoadState('domcontentloaded'); | ||
await expect(page).toHaveURL(`${baseURL}${features[0].path}`); | ||
}); | ||
|
||
await test.step('step-2: Verify CAAS collection content/specs', async () => { | ||
// verify number of cards in the collection | ||
await expect(await caas.caasCards).toHaveCount(data.cardsPerPage); | ||
Check failure on line 36 in tests/milo/caas.feature.test.js
|
||
|
||
// verify caas title and paginator | ||
await expect(await caas.caasTitle).toContainText(data.caasTitle); | ||
await expect(await caas.caasPaginator).toContainText(data.paginator); | ||
}); | ||
}); | ||
}); |