Skip to content

Commit 376a89a

Browse files
committed
test percy
1 parent c181afe commit 376a89a

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import {Before} from '@cucumber/cucumber';
2-
import {engage} from '@serenity-js/core';
1+
import {setDefaultTimeout} from '@cucumber/cucumber';
32

4-
import {Actors} from '../../../test/actors';
53
import {TIME} from '../../../test/constants/datetime.ts';
64

7-
Before({ timeout: TIME.oneMinuteInMs }, () => engage(new Actors()));
5+
setDefaultTimeout(TIME.tenSecsInMs);

features/visual-testing/percy.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ Feature: Percy Visual Testing
3131
Perfect to have error logs and not loose yourself 😎
3232
Run the ```npm run test:visual``` command to see it in action.
3333

34-
Then Percy ensures the fake element looks like the baseline "the-internet-login-form-element"
34+
Then Percy ensures the fake element looks like the baseline "the-internet-login-form-fake-element"

test/actors/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Actor, Cast } from '@serenity-js/core';
2-
import {BrowseTheWeb} from '@serenity-js/web';
1+
import {Actor, Cast} from '@serenity-js/core';
2+
import {BrowseTheWebWithWebdriverIO} from '@serenity-js/webdriverio';
33

44
import {TakePercyScreenshot} from '../abilities/percy-screenshot.ts';
55
import {ACTOR_NAMES} from '../constants/actors.ts';
@@ -9,12 +9,13 @@ export class Actors implements Cast {
99
switch (actor.name) {
1010
case ACTOR_NAMES.Percy: {
1111
return actor.whoCan(
12+
BrowseTheWebWithWebdriverIO.using(browser),
1213
TakePercyScreenshot.using()
1314
);
1415
}
1516
case ACTOR_NAMES.User: {
1617
return actor.whoCan(
17-
BrowseTheWeb.as(actor)
18+
BrowseTheWebWithWebdriverIO.using(browser)
1819
);
1920
}
2021
default: {

wdio.conf.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import process from 'node:process';
33
import { WebdriverIOConfig } from '@serenity-js/webdriverio';
44

55
import {wdioConfigVariables} from './config/wdio/wdio-config-variables';
6+
import {Actors} from './test/actors';
67

78
const configValues = wdioConfigVariables[process.env.EXEC_MODE];
89

@@ -17,6 +18,7 @@ export const config: WebdriverIOConfig = {
1718
framework: '@serenity-js/webdriverio',
1819

1920
serenity: {
21+
actors: new Actors(),
2022
// Use Cucumber.js test runner adapter
2123
// see: https://serenity-js.org/api/cucumber/
2224
runner: 'cucumber',

0 commit comments

Comments
 (0)