-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Snapshot makes shot even when its failed on specific functionali…
…ty (#177) * fix: Snapshot makes shots even if selector in function not found * fix: Comments update * fix: Update height on firefox for tests * fix: E2E Cleaning state remove and setup pipeline to save records for debug * fix: Update docker composer with mapping volume * fix: update reference for firefox * fix: Snapshot added E2E tests
- Loading branch information
1 parent
86811bc
commit 34392dc
Showing
17 changed files
with
243 additions
and
134 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
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
Binary file modified
BIN
+10.2 KB
(160%)
e2eTests/firefox/hideElements/baseline/hide-element-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file modified
BIN
+13 KB
(200%)
e2eTests/firefox/removeElements/baseline/remove-element-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* globals expect */ | ||
|
||
import path from 'path'; | ||
import fs from 'fs'; | ||
import { execSync } from 'child_process'; | ||
import config from './gridErrorSuiteScriptConfig'; | ||
|
||
describe('e2e Tests running gridErrorSuiteScript', () => { | ||
let dirPath; | ||
|
||
beforeEach(() => { | ||
dirPath = path.resolve(config.latest); | ||
|
||
if (fs.existsSync(dirPath)) { | ||
const files = fs.readdirSync(dirPath); | ||
files.forEach(file => fs.unlinkSync(`${dirPath}/${file}`)); | ||
fs.rmdirSync(dirPath); | ||
} | ||
}); | ||
|
||
it('throw exception and no snapshot is taken', async () => { | ||
let exitCode = 0; | ||
let stdout; | ||
try { | ||
stdout = execSync( | ||
'node ./lib/bin/run.js snap --browser chrome --config e2eTests/generic/gridError/gridErrorSuiteScriptConfig.json' | ||
).toString(); | ||
//pipe stdout to Jest console | ||
console.log(stdout); | ||
} catch (error) { | ||
exitCode = error.status; | ||
} | ||
|
||
expect(exitCode).toEqual(1); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
e2eTests/generic/gridError/gridErrorSuiteScriptConfig.json
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,15 @@ | ||
{ | ||
"gridUrl": "", | ||
"baseline": "./e2eTests/generic/gridError/baseline", | ||
"latest": "./e2eTests/generic/gridError/latest", | ||
"generatedDiffs": "./e2eTests/generic/gridError/generatedDiffs", | ||
"report": "./e2eTests/generic/gridError/reports", | ||
"remoteBucketName": "aye-spy", | ||
"remoteRegion": "eu-west-1", | ||
"scenarios": [ | ||
{ | ||
"url": "http://ayespy_report:4000", | ||
"label": "image", | ||
"viewports": [{"height": 2400, "width": 1024, "label": "large"}] | ||
}] | ||
} |
36 changes: 36 additions & 0 deletions
36
e2eTests/generic/nonExistScript/nonExistScriptSuiteScript.test.js
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,36 @@ | ||
/* globals expect */ | ||
|
||
import path from 'path'; | ||
import fs from 'fs'; | ||
import { execSync } from 'child_process'; | ||
import config from './nonExistScriptSuiteScriptConfig'; | ||
|
||
describe('e2e Tests running nonExistScriptSuiteScript', () => { | ||
let dirPath; | ||
|
||
beforeEach(() => { | ||
dirPath = path.resolve(config.latest); | ||
|
||
if (fs.existsSync(dirPath)) { | ||
const files = fs.readdirSync(dirPath); | ||
files.forEach(file => fs.unlinkSync(`${dirPath}/${file}`)); | ||
fs.rmdirSync(dirPath); | ||
} | ||
}); | ||
|
||
it('should successfully run the snap with with non exist script', async () => { | ||
let exitCode = 0; | ||
let stdout; | ||
try { | ||
stdout = execSync( | ||
'node ./lib/bin/run.js snap --browser chrome --config e2eTests/generic/nonExistScript/nonExistScriptSuiteScriptConfig.json' | ||
).toString(); | ||
//pipe stdout to Jest console | ||
console.log(stdout); | ||
} catch (error) { | ||
exitCode = error.status; | ||
} | ||
|
||
expect(exitCode).toEqual(0); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
e2eTests/generic/nonExistScript/nonExistScriptSuiteScriptConfig.json
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,16 @@ | ||
{ | ||
"gridUrl": "http://hub:4444/wd/hub", | ||
"baseline": "./e2eTests/generic/nonExistScript/baseline", | ||
"latest": "./e2eTests/generic/nonExistScript/latest", | ||
"generatedDiffs": "./e2eTests/generic/nonExistScript/generatedDiffs", | ||
"report": "./e2eTests/generic/nonExistScript/reports", | ||
"remoteBucketName": "aye-spy", | ||
"remoteRegion": "eu-west-1", | ||
"scenarios": [ | ||
{ | ||
"url": "http://ayespy_report:4000", | ||
"label": "image", | ||
"onReadyScript": "./nonExistScript.js", | ||
"viewports": [{"height": 2400, "width": 1024, "label": "large"}] | ||
}] | ||
} |
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,59 @@ | ||
/* globals expect */ | ||
import scenarioValidator from './scenarioValidator'; | ||
|
||
describe('Validate Scenario', () => { | ||
it('Valid Scenario', () => { | ||
const scenario = { | ||
url: 'http://lol.co.uk/', | ||
label: 'scenario-valid-viewport', | ||
viewports: [{ width: 1024, height: 800, label: 'large' }] | ||
}; | ||
|
||
expect(() => scenarioValidator(scenario)).not.toThrow(); | ||
}); | ||
it('Scenario missing height', () => { | ||
const scenario = { | ||
url: 'http://lol.co.uk/', | ||
label: 'scenario-height-missing', | ||
viewports: [{ width: 1024, label: 'large' }] | ||
}; | ||
expect(() => scenarioValidator(scenario)).toThrow( | ||
'scenario-height-missing has no height set' | ||
); | ||
}); | ||
|
||
it('Scenario missing width', () => { | ||
const scenario = { | ||
url: 'http://lol.co.uk/', | ||
label: 'scenario-width-missing', | ||
viewports: [{ height: 1024, label: 'large' }] | ||
}; | ||
|
||
expect(() => scenarioValidator(scenario)).toThrow( | ||
'scenario-width-missing has no width set' | ||
); | ||
}); | ||
|
||
it('Scenario missing label', () => { | ||
const scenario = { | ||
url: 'http://lol.co.uk/', | ||
label: 'scenario-label-missing', | ||
viewports: [{ height: 1024, width: 800 }] | ||
}; | ||
|
||
expect(() => scenarioValidator(scenario)).toThrow( | ||
'scenario-label-missing has no label set' | ||
); | ||
}); | ||
|
||
it('Scenario missing viewport', () => { | ||
const scenario = { | ||
url: 'http://lol.co.uk/', | ||
label: 'scenario-viewport-missing' | ||
}; | ||
|
||
expect(() => scenarioValidator(scenario)).toThrow( | ||
'scenario-viewport-missing has no viewports array defined' | ||
); | ||
}); | ||
}); |
Oops, something went wrong.