-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(cypress): Add E2E tests for creating highlight annotations on doc (
#618) * test(cypress): Add E2E tests for creating highlight annotations on doc * test(cypress): Remove constants
- Loading branch information
Mingze
authored
Oct 8, 2020
1 parent
c864d19
commit 64b92ac
Showing
4 changed files
with
59 additions
and
10 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,30 @@ | ||
// <reference types="Cypress" /> | ||
describe('Highlight', () => { | ||
beforeEach(() => { | ||
cy.visit('/'); | ||
}); | ||
|
||
it('should create a new highlight on a document', () => { | ||
// Show the preview | ||
cy.showPreview(Cypress.env('FILE_ID_DOC')); | ||
|
||
// Wait for the empty highlight layer to be present | ||
cy.getByTestId('ba-Layer--highlight'); | ||
|
||
// Assert that no highlight annotations are present | ||
cy.get('.ba-HighlightTarget').should('not.exist'); | ||
|
||
// Enter highlight creation mode | ||
cy.getByTestId('bp-AnnotationsControls-highlightBtn').click(); | ||
|
||
// Add a highlight annotation on the document | ||
cy.selectText(); | ||
cy.submitReply(); | ||
|
||
// Assert that at least one highlight annotation is present on the document | ||
cy.get('.ba-HighlightTarget'); | ||
|
||
// Exit highlight creation mode | ||
cy.getByTestId('bp-AnnotationsControls-highlightBtn').click(); | ||
}); | ||
}); |
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