-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update backstop, add focus testing, add some tests for focus states
- Loading branch information
Lance Harper
committed
Jan 24, 2018
1 parent
b7703fd
commit 41f1a6c
Showing
28 changed files
with
98 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = (chromy, scenario) => { | ||
if (Object.prototype.hasOwnProperty.call(scenario, 'focusSelector')) { | ||
const focusSelector = scenario.selectors[0]; | ||
const waitTime = scenario.focusWait || 0; | ||
chromy.evaluate(`_selector = '${focusSelector}'`); | ||
chromy | ||
.wait(focusSelector) | ||
.evaluate(() => { | ||
document.querySelector(_selector).focus(); // eslint-disable-line | ||
}) | ||
.wait(waitTime); | ||
} | ||
}; |
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,15 +1,13 @@ | ||
module.exports = (chromy, scenario, vp) => { | ||
const { hoverSelector } = scenario; | ||
const waitTime = scenario.hoverWait || 0; | ||
|
||
|
||
if (hoverSelector) { | ||
module.exports = (chromy, scenario) => { | ||
if (Object.prototype.hasOwnProperty.call(scenario, 'hoverSelector')) { | ||
const waitTime = scenario.hoverWait || 0; | ||
const hoverSelector = scenario.selectors[0]; | ||
chromy | ||
.wait(hoverSelector) | ||
.rect(hoverSelector) | ||
.result((rect) => { | ||
chromy.mouseMoved(rect.left, rect.top); | ||
chromy.wait(waitTime); | ||
}); | ||
}) | ||
.wait(waitTime); | ||
} | ||
}; |
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,6 +1,8 @@ | ||
const hover = require('./hover'); | ||
const focus = require('./focus'); | ||
|
||
module.exports = (chromy, scenario, vp) => { | ||
hover(chromy, scenario); | ||
focus(chromy, scenario); | ||
// add more ready handlers here... | ||
}; |
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 |
---|---|---|
|
@@ -4,7 +4,5 @@ module.exports = [ | |
selectors: [ | ||
'[data-backstop="simple-card"]', | ||
], | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
}, | ||
]; |
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 |
---|---|---|
|
@@ -4,7 +4,5 @@ module.exports = [ | |
selectors: [ | ||
'[data-backstop="headings"]', | ||
], | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
}, | ||
]; |
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 |
---|---|---|
|
@@ -7,7 +7,5 @@ module.exports = [ | |
hoverSelectors: [ | ||
'[data-backstop="cdr-icon-add"]', | ||
], | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
}, | ||
]; |
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 |
---|---|---|
|
@@ -4,7 +4,5 @@ module.exports = [ | |
selectors: [ | ||
'[data-backstop="lists"]', | ||
], | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
}, | ||
]; |
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 |
---|---|---|
|
@@ -4,7 +4,5 @@ module.exports = [ | |
selectors: [ | ||
'[data-backstop="radios"]', | ||
], | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
}, | ||
]; |
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 |
---|---|---|
|
@@ -4,7 +4,5 @@ module.exports = [ | |
selectors: [ | ||
'[data-backstop="ratings"]', | ||
], | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
}, | ||
]; |
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 |
---|---|---|
|
@@ -4,7 +4,5 @@ module.exports = [ | |
selectors: [ | ||
'[data-backstop="selects"]', | ||
], | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
}, | ||
]; |
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 |
---|---|---|
|
@@ -4,7 +4,5 @@ module.exports = [ | |
selectors: [ | ||
'[data-backstop="search"]', | ||
], | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
}, | ||
]; |
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,10 +1,6 @@ | ||
module.exports = [ | ||
{ | ||
label: 'Mountains', | ||
selectors: [ | ||
'[data-backstop="mountain-shapes"]', | ||
], | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
}, | ||
]; | ||
module.exports = [{ | ||
label: 'Mountains', | ||
selectors: [ | ||
'[data-backstop="mountain-shapes"]', | ||
], | ||
}]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
module.exports = [{ | ||
label: '{NAME-PASCAL}', | ||
delay: 0, | ||
misMatchThreshold: 0.1, | ||
selectors: [], | ||
}]; |
Oops, something went wrong.