@@ -8,8 +8,8 @@ const TIMEOUT_MS = 40000;
88 {
99 name : "next-sample-pages-router" ,
1010 baseUrl : Cypress . env ( "BASE_URL_PAGES_ROUTER" ) ,
11- }
12- ] . forEach ( ( { name, baseUrl} ) => {
11+ } ,
12+ ] . forEach ( ( { name, baseUrl } ) => {
1313 describe ( `Embedding SDK: ${ name } compatibility` , ( ) => {
1414 beforeEach ( ( ) => {
1515 Cypress . config ( "baseUrl" , baseUrl ) ;
@@ -20,31 +20,36 @@ const TIMEOUT_MS = 40000;
2020 url : "/static-question" ,
2121 } ) ;
2222
23- expect ( cy . findByTestId ( "visualization-root" , { timeout : TIMEOUT_MS } ) . should ( "exist" ) ) ;
23+ cy . findByTestId ( "visualization-root" , { timeout : TIMEOUT_MS } ) . should (
24+ "exist" ,
25+ ) ;
2426 } ) ;
2527
2628 it ( "should open an Interactive Question" , ( ) => {
2729 cy . visit ( {
2830 url : "/interactive-question" ,
2931 } ) ;
3032
31- expect ( cy . findByText ( "Orders + People" , { timeout : TIMEOUT_MS } ) . should ( "exist" ) ) ;
32-
33- expect ( cy . findByTestId ( "interactive-question-result-toolbar" ) . should ( "exist" ) ) ;
34-
35- expect ( cy . findByTestId ( "visualization-root" ) . should ( "exist" ) ) ;
33+ cy . findByText ( "Orders + People" , { timeout : TIMEOUT_MS } ) . should ( "exist" ) ;
34+ cy . findByTestId ( "interactive-question-result-toolbar" ) . should ( "exist" ) ;
35+ cy . findByTestId ( "visualization-root" ) . should ( "exist" ) ;
3636 } ) ;
3737
3838 it ( "should open a Static Dashboard" , ( ) => {
3939 cy . visit ( {
4040 url : "/static-dashboard" ,
4141 } ) ;
4242
43- expect ( cy . findByTestId ( "embed-frame" , { timeout : TIMEOUT_MS } ) . should ( "exist" ) ) ;
44- cy . findByTestId ( "embed-frame" , { timeout : TIMEOUT_MS } ) . within ( ( ) => {
45- cy . findByTestId ( "embed-frame-header" ) . should ( "exist" ) ;
43+ sdkRoot ( ) . should ( "exist" ) ;
44+ sdkRoot ( ) . within ( ( ) => {
45+ cy . findByRole ( "heading" , { name : "Static Dashboard Example" } ) . should (
46+ "exist" ,
47+ ) ;
4648
47- cy . findByText ( "E-commerce Insights" ) . should ( "exist" ) ;
49+ cy . findByRole ( "heading" , {
50+ name : "E-commerce Insights" ,
51+ timeout : TIMEOUT_MS ,
52+ } ) . should ( "exist" ) ;
4853
4954 cy . findByTestId ( "fixed-width-filters" ) . should ( "exist" ) ;
5055
@@ -57,11 +62,16 @@ const TIMEOUT_MS = 40000;
5762 url : "/interactive-dashboard" ,
5863 } ) ;
5964
60- expect ( cy . findByTestId ( "embed-frame" , { timeout : TIMEOUT_MS } ) . should ( "exist" ) ) ;
61- cy . findByTestId ( "embed-frame" , { timeout : TIMEOUT_MS } ) . within ( ( ) => {
62- cy . findByTestId ( "embed-frame-header" ) . should ( "exist" ) ;
65+ sdkRoot ( ) . should ( "exist" ) ;
66+ sdkRoot ( ) . within ( ( ) => {
67+ cy . findByRole ( "heading" , {
68+ name : "Interactive Dashboard Example" ,
69+ } ) . should ( "exist" ) ;
6370
64- cy . findByText ( "E-commerce Insights" ) . should ( "exist" ) ;
71+ cy . findByRole ( "heading" , {
72+ name : "E-commerce Insights" ,
73+ timeout : TIMEOUT_MS ,
74+ } ) . should ( "exist" ) ;
6575
6676 cy . findByTestId ( "fixed-width-filters" ) . should ( "exist" ) ;
6777
@@ -70,3 +80,7 @@ const TIMEOUT_MS = 40000;
7080 } ) ;
7181 } ) ;
7282} ) ;
83+
84+ function sdkRoot ( ) {
85+ return cy . get ( "#metabase-sdk-root" , { timeout : TIMEOUT_MS } ) ;
86+ }
0 commit comments