Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@ jobs:
run: "BROWSER=firefox node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
- name: run webkit tests
run: "BROWSER=webkit node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
- name: run unit tests
- name: run chromium unit tests
run: ./node_modules/.bin/mocha test/helper/Playwright_test.js --timeout 5000
- name: run firefox unit tests
run: "BROWSER=firefox ./node_modules/.bin/mocha test/helper/Playwright_test.js --timeout 5000"
4 changes: 2 additions & 2 deletions lib/helper/Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -2139,9 +2139,9 @@ class Playwright extends Helper {
let chunked = chunkArray(props, values.length);
chunked = chunked.filter((val) => {
for (let i = 0; i < val.length; ++i) {
const _acutal = Number.isNaN(val[i]) || (typeof values[i]) === 'string' ? val[i] : Number.parseInt(val[i], 10);
const _actual = Number.isNaN(val[i]) || (typeof values[i]) === 'string' ? values[i] : Number.parseInt(val[i], 10);
const _expected = Number.isNaN(values[i]) || (typeof values[i]) === 'string' ? values[i] : Number.parseInt(values[i], 10);
if (_acutal !== _expected) return false;
if (_actual !== _expected) return false;
}
return true;
});
Expand Down
12 changes: 12 additions & 0 deletions test/helper/Playwright_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe('Playwright', function () {
I = new Playwright({
url: siteUrl,
windowSize: '500x700',
browser: process.env.BROWSER || 'chromium',
show: false,
waitForTimeout: 5000,
waitForAction: 500,
Expand Down Expand Up @@ -112,6 +113,17 @@ describe('Playwright', function () {
});
});

describe('#seeCssPropertiesOnElements', () => {
it('should check background-color css property for given element', async () => {
try {
await I.amOnPage('https://codecept.io/helpers/Playwright/');
await I.seeCssPropertiesOnElements('.navbar', { 'background-color': 'rgb(128, 90, 213)' });
} catch (e) {
e.message.should.include('expected element (.navbar) to have CSS property { \'background-color\': \'rgb(128, 90, 213)\' }');
}
});
});

webApiTests.tests();

describe('#click', () => {
Expand Down