Skip to content

Commit 98acae0

Browse files
authored
fix(vrt): Fix browser list returned in Applitools config in local cases (#4961)
1 parent 244c3f7 commit 98acae0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

applitools.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ const resolution = { width: 1024, height: 768 };
33

44
const currentBranch = branch.sync();
55

6+
// these variable are involved in the `CI_VRT_` workflows: `full` and `chrome`
7+
// when this config is consumed by those workflows,
8+
// VRT_MODE is passed as an env var with either value
69
const vrtMode = process.env.VRT_MODE;
710
const VRT_MODE_CHROME = "chrome";
811
const VRT_MODE_FULL = "full";
@@ -15,7 +18,12 @@ const browsersToTest = () => {
1518
{ width: resolution.width, height: resolution.height, name: 'edgechromium' }
1619
]
1720

18-
return browserTests.filter(test => {
21+
// if VRT_MODE is not specified
22+
return vrtMode === undefined
23+
// return full browser list
24+
? browserTests
25+
// or return a filtered list based on the value of VRT_MODE
26+
: browserTests.filter(test => {
1927
return vrtMode === VRT_MODE_FULL || (vrtMode === VRT_MODE_CHROME && test.name === VRT_MODE_CHROME)
2028
})
2129
}

0 commit comments

Comments
 (0)