forked from usablica/intro.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cypress test for added later element
- Loading branch information
1 parent
9031e45
commit 0a60954
Showing
2 changed files
with
44 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
context("Added later element", () => { | ||
const addedLaterElId = "later_added"; | ||
const stepOneText = "step one"; | ||
const stepTwoText = "step two, click on create btn"; | ||
const stepThreeText = "added later element"; | ||
const createDivBtnSelector = "#create-div-button"; | ||
beforeEach(() => { | ||
cy.visit("./cypress/setup/index.html").then((window) => { | ||
window | ||
.introJs() | ||
.setOptions({ | ||
disableInteraction: false, | ||
steps: [ | ||
{ | ||
intro: stepOneText, | ||
}, | ||
{ | ||
intro: stepTwoText, | ||
element: createDivBtnSelector, | ||
}, | ||
{ | ||
intro: stepThreeText, | ||
element: "#" + addedLaterElId, | ||
}, | ||
], | ||
}) | ||
.start(); | ||
}); | ||
}); | ||
|
||
it("should find by selector and highlight added later element", () => { | ||
cy.get(".introjs-tooltiptext").contains(stepOneText); | ||
cy.nextStep(); | ||
cy.get(".introjs-tooltiptext").contains(stepTwoText); | ||
cy.wait(500); | ||
cy.get(createDivBtnSelector).click(); | ||
cy.nextStep(); | ||
cy.wait(500); | ||
cy.get("#" + addedLaterElId) | ||
.filter(".introjs-showElement") | ||
.contains("Later added div"); | ||
cy.compareSnapshot("added-later-element-end", 0.05); | ||
}); | ||
}); |
Binary file added
BIN
+117 KB
...ess/snapshots/base/tour/added-later-element.js/added-later-element-end-base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.