File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
snapshots/base/tour/added-later-element.js Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ context ( "Added later element" , ( ) => {
2+ const addedLaterElId = "later_added" ;
3+ const stepOneText = "step one" ;
4+ const stepTwoText = "step two, click on create btn" ;
5+ const stepThreeText = "added later element" ;
6+ const createDivBtnSelector = "#create-div-button" ;
7+ beforeEach ( ( ) => {
8+ cy . visit ( "./cypress/setup/index.html" ) . then ( ( window ) => {
9+ window
10+ . introJs ( )
11+ . setOptions ( {
12+ disableInteraction : false ,
13+ steps : [
14+ {
15+ intro : stepOneText ,
16+ } ,
17+ {
18+ intro : stepTwoText ,
19+ element : createDivBtnSelector ,
20+ } ,
21+ {
22+ intro : stepThreeText ,
23+ element : "#" + addedLaterElId ,
24+ } ,
25+ ] ,
26+ } )
27+ . start ( ) ;
28+ } ) ;
29+ } ) ;
30+
31+ it ( "should find by selector and highlight added later element" , ( ) => {
32+ cy . get ( ".introjs-tooltiptext" ) . contains ( stepOneText ) ;
33+ cy . nextStep ( ) ;
34+ cy . get ( ".introjs-tooltiptext" ) . contains ( stepTwoText ) ;
35+ cy . wait ( 500 ) ;
36+ cy . get ( createDivBtnSelector ) . click ( ) ;
37+ cy . nextStep ( ) ;
38+ cy . wait ( 500 ) ;
39+ cy . get ( "#" + addedLaterElId )
40+ . filter ( ".introjs-showElement" )
41+ . contains ( "Later added div" ) ;
42+ cy . compareSnapshot ( "added-later-element-end" , 0.05 ) ;
43+ } ) ;
44+ } ) ;
You can’t perform that action at this time.
0 commit comments