11// assumes no Head Tags as starting state
22describe ( "Head Tags" , ( ) => {
3+ before ( ( ) => {
4+ cy . task ( "seed:content" , "fixtures/item.json" ) . then (
5+ ( { model, fields, items } ) => {
6+ Cypress . env ( "modelZUID" , model ?. ZUID ) ;
7+ Cypress . env ( "itemZUID" , items [ 0 ] ?. meta ?. ZUID ) ;
8+ }
9+ ) ;
10+ } ) ;
311 it ( "creates and deletes new head tag" , ( ) => {
412 cy . waitOn ( "/v1/content/models*" , ( ) => {
5- cy . visit ( "/content/6-556370-8sh47g/7-b939a4-457q19/head" ) ;
13+ cy . visit (
14+ `/content/${ Cypress . env ( "modelZUID" ) } /${ Cypress . env ( "itemZUID" ) } /head`
15+ ) ;
616 } ) ;
717
8- cy . contains ( "Create Head Tag" , { timeout : 10000 } ) . click ( ) ;
18+ cy . contains ( "Create Head Tag" ) . click ( ) ;
919
10- cy . get ( "[data-cy= newTagCard] ")
20+ cy . getBySelector ( " newTagCard")
1121 . last ( )
1222 . find ( ".MuiSelect-select" )
1323 . click ( { force : true } ) ;
@@ -17,16 +27,15 @@ describe("Head Tags", () => {
1727 . find ( '[data-value="script"]' )
1828 . click ( { force : true } ) ;
1929
20- //cy.get("[data-cy=tagCard]:last-child")
21- cy . get ( "[data-cy=newTagCard]" )
30+ cy . getBySelector ( "newTagCard" )
2231 . last ( )
2332 . contains ( "Value" )
2433 . parent ( )
2534 . find ( "input" )
2635 . clear ( )
2736 . type ( "Changing the value of content" ) ;
2837
29- cy . get ( "[data-cy= newTagCard] ")
38+ cy . getBySelector ( " newTagCard")
3039 . last ( )
3140 . contains ( "Attribute" )
3241 . parent ( )
@@ -35,11 +44,11 @@ describe("Head Tags", () => {
3544 . type ( "newAttr" ) ;
3645
3746 // Saves Head Tag
38- cy . get ( "[data-cy= newTagCard] ") . last ( ) . find ( "#SaveItemButton" ) . click ( ) ;
47+ cy . getBySelector ( " newTagCard") . last ( ) . find ( "#SaveItemButton" ) . click ( ) ;
3948 cy . contains ( "New head tag created" ) ;
4049
4150 // Deletes Head Tag
42- cy . get ( "[data-cy= tagCard] ")
51+ cy . getBySelector ( " tagCard")
4352 . last ( )
4453 . contains ( "Delete Head Tag" )
4554 . invoke ( "show" )
0 commit comments