-
-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad1bb15
commit 162b01b
Showing
4 changed files
with
107 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const Locator = require('../../locator'); | ||
|
||
const prefixMessage = 'Element'; | ||
|
||
function seeElementError(locator) { | ||
if (typeof locator === 'object') { | ||
locator = JSON.stringify(locator); | ||
} | ||
throw new Error(`${prefixMessage} "${(new Locator(locator))}" is still visible on page.`); | ||
} | ||
|
||
function seeElementInDOMError(locator) { | ||
if (typeof locator === 'object') { | ||
locator = JSON.stringify(locator); | ||
} | ||
throw new Error(`${prefixMessage} "${(new Locator(locator))}" is still seen in DOM.`); | ||
} | ||
|
||
function dontSeeElementError(locator) { | ||
if (typeof locator === 'object') { | ||
locator = JSON.stringify(locator); | ||
} | ||
throw new Error(`${prefixMessage} "${(new Locator(locator))}" is not visible on page.`); | ||
} | ||
|
||
function dontSeeElementInDOMError(locator) { | ||
if (typeof locator === 'object') { | ||
locator = JSON.stringify(locator); | ||
} | ||
throw new Error(`${prefixMessage} "${(new Locator(locator))}" is not seen in DOM.`); | ||
} | ||
|
||
module.exports = { | ||
seeElementError, | ||
dontSeeElementError, | ||
seeElementInDOMError, | ||
dontSeeElementInDOMError, | ||
}; |