Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support not.checked assertion, closes #8
- Loading branch information
Showing
4 changed files
with
40 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules/ | ||
cypress/videos/ |
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,14 @@ | ||
<html> | ||
<head></head> | ||
<body> | ||
<div> | ||
<input type="checkbox" id="enrolled" /> | ||
<span>Enrolled already</span> | ||
</div> | ||
|
||
<div> | ||
<input type="checkbox" id="agreed" checked /> | ||
<span>Agree</span> | ||
</div> | ||
</body> | ||
</html> |
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 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import '../../src' | ||
|
||
describe('checkbox', () => { | ||
it('checks the box when it is not checked already', () => { | ||
cy.visit('cypress/checkbox.html') | ||
cy.get('#enrolled').if('not.checked').check() | ||
}) | ||
|
||
it('does nothing if the box is already checked', () => { | ||
cy.visit('cypress/checkbox.html') | ||
cy.get('#agreed').if('not.checked').check() | ||
}) | ||
}) |
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