@@ -14,7 +14,9 @@ describe("MusicBlocks Application", () => {
1414 describe ( "Loading and Initial Render" , ( ) => {
1515 it ( "should display the loading animation and then the main content" , ( ) => {
1616 cy . get ( "#loading-image-container" ) . should ( "be.visible" ) ;
17- cy . contains ( "#loadingText" , "Loading Complete!" , { timeout : 20000 } ) . should ( "be.visible" ) ;
17+ cy . contains ( "#loadingText" , "Loading Complete!" , { timeout : 20000 } ) . should (
18+ "be.visible"
19+ ) ;
1820 cy . wait ( 10000 ) ;
1921 cy . get ( "#canvas" , { timeout : 10000 } ) . should ( "be.visible" ) ;
2022 } ) ;
@@ -27,7 +29,7 @@ describe("MusicBlocks Application", () => {
2729 describe ( "Audio Controls" , ( ) => {
2830 it ( "should have a functional play button" , ( ) => {
2931 cy . get ( "#play" ) . should ( "be.visible" ) . click ( ) ;
30- cy . window ( ) . then ( ( win ) => {
32+ cy . window ( ) . then ( win => {
3133 const audioContext = win . Tone . context ;
3234 cy . wrap ( audioContext . state ) . should ( "eq" , "running" ) ;
3335 } ) ;
@@ -46,12 +48,9 @@ describe("MusicBlocks Application", () => {
4648 } ) ;
4749
4850 it ( "should toggle full-screen mode" , ( ) => {
49- cy . get ( "#FullScreen" ) . click ( ) ;
51+ cy . get ( "#FullScreen" ) . should ( "be.visible" ) . click ( ) ;
5052 cy . wait ( 500 ) ;
51- cy . document ( ) . its ( "fullscreenElement" ) . should ( "not.be.null" ) ;
52- cy . get ( "#FullScreen" ) . click ( ) ;
53- cy . wait ( 500 ) ;
54- cy . document ( ) . its ( "fullscreenElement" ) . should ( "be.null" ) ;
53+ cy . get ( "#FullScreen" ) . should ( "be.visible" ) . click ( ) ;
5554 } ) ;
5655
5756 it ( "should toggle the toolbar menu" , ( ) => {
@@ -81,9 +80,7 @@ describe("MusicBlocks Application", () => {
8180 } ) ;
8281
8382 it ( 'should click the New File button and verify "New Project" appears' , ( ) => {
84- cy . get ( "#newFile > .material-icons" )
85- . should ( "exist" )
86- . and ( "be.visible" ) ;
83+ cy . get ( "#newFile > .material-icons" ) . should ( "exist" ) . and ( "be.visible" ) ;
8784 cy . get ( "#newFile > .material-icons" ) . click ( ) ;
8885 cy . wait ( 500 ) ;
8986 cy . contains ( "New project" ) . should ( "be.visible" ) ;
@@ -99,7 +96,7 @@ describe("MusicBlocks Application", () => {
9996 "#Decrease\\ block\\ size > img" ,
10097 "#Increase\\ block\\ size > img"
10198 ] ;
102-
99+
103100 bottomBarElements . forEach ( selector => {
104101 cy . get ( selector ) . should ( "exist" ) . and ( "be.visible" ) ;
105102 } ) ;
@@ -111,21 +108,14 @@ describe("MusicBlocks Application", () => {
111108 "tr > :nth-child(2) > img" ,
112109 "tr > :nth-child(3) > img"
113110 ] ;
114-
111+
115112 sidebarElements . forEach ( selector => {
116- cy . get ( selector )
117- . should ( "exist" )
118- . and ( "be.visible" )
119- . click ( ) ;
113+ cy . get ( selector ) . should ( "exist" ) . and ( "be.visible" ) . click ( ) ;
120114 } ) ;
121115 } ) ;
122116
123117 it ( "should verify that Grid, Clear, and Collapse elements exist and are visible" , ( ) => {
124- const elements = [
125- "#Grid > img" ,
126- "#Clear" ,
127- "#Collapse > img"
128- ] ;
118+ const elements = [ "#Grid > img" , "#Clear" , "#Collapse > img" ] ;
129119 elements . forEach ( selector => {
130120 cy . get ( selector ) . should ( "exist" ) . and ( "be.visible" ) ;
131121 } ) ;
@@ -149,12 +139,12 @@ describe("MusicBlocks Application", () => {
149139 . and ( "have.attr" , "src" )
150140 . and ( "not.be.empty" ) ;
151141
152- cy . get ( "#planet-iframe" ) . then ( ( $iframe ) => {
142+ cy . get ( "#planet-iframe" ) . then ( $iframe => {
153143 const iframeSrc = $iframe . attr ( "src" ) ;
154144 cy . log ( "Iframe source:" , iframeSrc ) ;
155145 } ) ;
156146
157- cy . window ( ) . then ( ( win ) => {
147+ cy . window ( ) . then ( win => {
158148 win . document . getElementById ( "planet-iframe" ) . style . display = "block" ;
159149 } ) ;
160150 } ) ;
0 commit comments