Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

:microscope: - experimental

## [2.11.1]
- :rocket: updated dependencies

## [2.11.0]
- :rocket: added export of `QavajsPlaywrightWorld` and `QavajsPlaywrightElectronWorld`

Expand Down
1,191 changes: 405 additions & 786 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qavajs/steps-playwright",
"version": "2.11.0",
"version": "2.11.1",
"description": "qavajs steps to interact with playwright",
"main": "./index.js",
"scripts": {
Expand Down Expand Up @@ -28,23 +28,23 @@
"devDependencies": {
"@cucumber/cucumber": "^12.2.0",
"@qavajs/console-formatter": "^1.1.1",
"@qavajs/core": "^2.7.0",
"@qavajs/core": "^2.10.0",
"@qavajs/html-formatter": "^1.0.0",
"@qavajs/memory": "^1.10.2",
"@qavajs/validation": "^1.3.0",
"@qavajs/memory": "^1.10.3",
"@qavajs/validation": "^1.4.1",
"@qavajs/webstorm-adapter": "^8.0.0",
"@types/express": "^5.0.3",
"@types/node": "^24.5.2",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"electron": "^38.2.0",
"@types/express": "^5.0.4",
"@types/node": "^24.9.1",
"@vitest/coverage-v8": "^4.0.3",
"@vitest/ui": "^4.0.3",
"electron": "^38.4.0",
"express": "^5.1.0",
"ts-node": "^10.9.2",
"typescript": "^5.9.2",
"vitest": "^3.2.4"
"typescript": "^5.9.3",
"vitest": "^4.0.3"
},
"dependencies": {
"@playwright/test": "^1.55.1"
"@playwright/test": "^1.56.1"
},
"keywords": [
"test",
Expand Down
4 changes: 2 additions & 2 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When('I open {value} url', async function (this: QavajsPlaywrightWorld, url: Mem
* @example I type 'wikipedia' into 'Google Input'
*/
When('I type {value} (in)to {playwrightLocator}', async function (this: QavajsPlaywrightWorld, value: MemoryValue, locator: Locator): Promise<void> {
const typeValue = await value.value()
const typeValue = await value.value();
await locator.fill(typeValue);
});

Expand Down Expand Up @@ -78,7 +78,7 @@ When('I double click {playwrightLocator}', async function (this: QavajsPlaywrigh
* @example I clear 'Google Input'
*/
When('I clear {playwrightLocator}', async function (this: QavajsPlaywrightWorld, locator: Locator) {
await locator.fill('');
await locator.clear();
});

/**
Expand Down
2 changes: 1 addition & 1 deletion src/utils/tracingManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TracingManager {
world.attach(zipBuffer.toString('base64'), 'base64:application/zip');
}
} catch (err) {
console.warn('Trace was not recorded');
console.warn(`Trace was not recorded\n${err}`);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test-e2e/apps/mock.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
})
} catch (err) {
const li = document.createElement('li');
li.innerText = 'Failed to load!';
li.innerText = `Failed to load!\n${err}`;
list.appendChild(li);
}
}
Expand Down
2 changes: 1 addition & 1 deletion test-e2e/features/mock.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Feature: mock
When I create mock for '**/users' as 'usersService'
And I set '$usersService' mock to abort with 'failed' reason
And I open '$mockPage' url
Then I expect text of 'User (1)' to be equal 'Failed to load!'
Then I expect text of 'User (1)' to contain 'Failed to load!'
8 changes: 4 additions & 4 deletions test/browserManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ describe('context', () => {

test('launch new context if not driver launched', async () => {
const browserManager = new Playwright(driverProvider as any);
expect(() => browserManager.launchContext('newContext',{})).rejects.toThrow('No active drivers launched')
await expect(() => browserManager.launchContext('newContext',{})).rejects.toThrow('No active drivers launched')
});

test('switch to not existing context', async () => {
const browserManager = new Playwright(driverProvider as any);
await browserManager.launchDriver('default', { browserName: 'chrome', isElectron: false });
expect(() => browserManager.switchContext('context2')).rejects.toThrow(`Context 'context2' was not found`)
await expect(() => browserManager.switchContext('context2')).rejects.toThrow(`Context 'context2' was not found`)
});

});
Expand Down Expand Up @@ -228,7 +228,7 @@ describe('switch driver', () => {
test('switch to not existing driver', async () => {
const browserManager = new Playwright(driverProvider as any);
await browserManager.launchDriver('default', { browserName: 'chrome', isElectron: false });
expect(() => browserManager.switchDriver('chrome')).rejects.toThrow(`Driver 'chrome' was not found`)
await expect(() => browserManager.switchDriver('chrome')).rejects.toThrow(`Driver 'chrome' was not found`)
});

});
Expand Down Expand Up @@ -293,7 +293,7 @@ describe('teardown', () => {
test('close not existing driver', async () => {
const browserManager = new Playwright(driverProvider as any);
await browserManager.launchDriver('default', { browserName: 'chrome', isElectron: false });
expect(() => browserManager.closeDriver('chrome')).rejects.toThrow(`Driver 'chrome' was not found`)
await expect(() => browserManager.closeDriver('chrome')).rejects.toThrow(`Driver 'chrome' was not found`)
});

test('reuse session browser', async () => {
Expand Down
1 change: 1 addition & 0 deletions test/poImport.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { locator } from '../po'
import { test, expect } from 'vitest';

test.each([
locator,
locator.template,
Expand Down