-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FI-1237 feat: run tests via Playwright
- Loading branch information
Showing
31 changed files
with
373 additions
and
5,250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {test} from 'autotests'; | ||
|
||
import {expect} from '@playwright/test'; | ||
|
||
test('get started link', {meta: {testId: '19'}}, async ({page}) => { | ||
await page.goto('https://playwright.dev/'); | ||
|
||
// Click the get started link. | ||
await page.getByRole('link', {name: 'Get started'}).click(); | ||
|
||
// Expects page to have a heading with the name of Installation. | ||
await expect(page.getByRole('heading', {name: 'Installation'})).toBeVisible(); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import {getRunTest, safeJsError} from './utils/test'; | ||
import {fixture, test as testcafeTest} from './testcafe'; | ||
import {getRunTest} from './utils/test'; | ||
|
||
import type {TestFunction} from './types/internal'; | ||
|
||
import {test as playwrightTest} from '@playwright/test'; | ||
|
||
/** | ||
* Creates test with name, metatags, options and test function. | ||
* @internal | ||
*/ | ||
export const test: TestFunction = (name, options, testFn) => { | ||
fixture(' - e2ed - ').skipJsErrors(safeJsError); | ||
|
||
const runTest = getRunTest({name, options, testFn}); | ||
|
||
testcafeTest(name, runTest); | ||
playwrightTest(name, runTest); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1 @@ | ||
import {t as originalTestController} from 'testcafe-without-typecheck'; | ||
|
||
import {E2edError} from './utils/error'; | ||
|
||
import type {TestController, Values} from './types/internal'; | ||
|
||
/** | ||
* Proxy handler for wrapping all tries to get TestController properties. | ||
*/ | ||
const get: ProxyHandler<TestController>['get'] = ( | ||
target, | ||
property, | ||
receiver, | ||
): Values<TestController> => { | ||
try { | ||
const result = Reflect.get(target, property, receiver) as Values<TestController>; | ||
|
||
return result; | ||
} catch (cause) { | ||
throw new E2edError( | ||
`Caught an error on getting property "${String(property)}" of testController`, | ||
{cause}, | ||
); | ||
} | ||
}; | ||
|
||
/** | ||
* TestController from TestCafe with wrapping of all thrown errors. | ||
*/ | ||
export const testController: typeof originalTestController = new Proxy(originalTestController, { | ||
get, | ||
}); | ||
export const testController = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.