@@ -9,18 +9,15 @@ beforeEach(() => {
99
1010 // This page is restricted, so we will be shown the login form. Fill it out & submit.
1111 cy . loginViaForm ( Cypress . env ( 'DSPACE_TEST_ADMIN_USER' ) , Cypress . env ( 'DSPACE_TEST_ADMIN_PASSWORD' ) ) ;
12-
13- // We need to wait for the correction types allowed for the item to be loaded to be sure that each tab is fully loaded.
14- // This because the edit item page causes often tests to fails due to timeout.
15- cy . intercept ( 'GET' , 'server/api/config/correctiontypes/search/findByItem*' ) . as ( 'correctionTypes' ) ;
16- cy . wait ( '@correctionTypes' ) ;
1712} ) ;
1813
1914describe ( 'Edit Item > Edit Metadata tab' , ( ) => {
2015 it ( 'should pass accessibility tests' , ( ) => {
16+ cy . get ( 'a[data-test="metadata"]' ) . should ( 'be.visible' ) ;
2117 cy . get ( 'a[data-test="metadata"]' ) . click ( ) ;
2218
23- // Our selected tab should be active
19+ // Our selected tab should be both visible & active
20+ cy . get ( 'a[data-test="metadata"]' ) . should ( 'be.visible' ) ;
2421 cy . get ( 'a[data-test="metadata"]' ) . should ( 'have.class' , 'active' ) ;
2522
2623 // <ds-edit-item-page> tag must be loaded
@@ -39,9 +36,11 @@ describe('Edit Item > Edit Metadata tab', () => {
3936describe ( 'Edit Item > Status tab' , ( ) => {
4037
4138 it ( 'should pass accessibility tests' , ( ) => {
39+ cy . get ( 'a[data-test="status"]' ) . should ( 'be.visible' ) ;
4240 cy . get ( 'a[data-test="status"]' ) . click ( ) ;
4341
44- // Our selected tab should be active
42+ // Our selected tab should be both visible & active
43+ cy . get ( 'a[data-test="status"]' ) . should ( 'be.visible' ) ;
4544 cy . get ( 'a[data-test="status"]' ) . should ( 'have.class' , 'active' ) ;
4645
4746 // <ds-item-status> tag must be loaded
@@ -55,9 +54,11 @@ describe('Edit Item > Status tab', () => {
5554describe ( 'Edit Item > Bitstreams tab' , ( ) => {
5655
5756 it ( 'should pass accessibility tests' , ( ) => {
57+ cy . get ( 'a[data-test="bitstreams"]' ) . should ( 'be.visible' ) ;
5858 cy . get ( 'a[data-test="bitstreams"]' ) . click ( ) ;
5959
60- // Our selected tab should be active
60+ // Our selected tab should be both visible & active
61+ cy . get ( 'a[data-test="bitstreams"]' ) . should ( 'be.visible' ) ;
6162 cy . get ( 'a[data-test="bitstreams"]' ) . should ( 'have.class' , 'active' ) ;
6263
6364 // <ds-item-bitstreams> tag must be loaded
@@ -82,9 +83,11 @@ describe('Edit Item > Bitstreams tab', () => {
8283describe ( 'Edit Item > Curate tab' , ( ) => {
8384
8485 it ( 'should pass accessibility tests' , ( ) => {
86+ cy . get ( 'a[data-test="curate"]' ) . should ( 'be.visible' ) ;
8587 cy . get ( 'a[data-test="curate"]' ) . click ( ) ;
8688
87- // Our selected tab should be active
89+ // Our selected tab should be both visible & active
90+ cy . get ( 'a[data-test="curate"]' ) . should ( 'be.visible' ) ;
8891 cy . get ( 'a[data-test="curate"]' ) . should ( 'have.class' , 'active' ) ;
8992
9093 // <ds-item-curate> tag must be loaded
@@ -98,9 +101,11 @@ describe('Edit Item > Curate tab', () => {
98101describe ( 'Edit Item > Relationships tab' , ( ) => {
99102
100103 it ( 'should pass accessibility tests' , ( ) => {
104+ cy . get ( 'a[data-test="relationships"]' ) . should ( 'be.visible' ) ;
101105 cy . get ( 'a[data-test="relationships"]' ) . click ( ) ;
102106
103- // Our selected tab should be active
107+ // Our selected tab should be both visible & active
108+ cy . get ( 'a[data-test="relationships"]' ) . should ( 'be.visible' ) ;
104109 cy . get ( 'a[data-test="relationships"]' ) . should ( 'have.class' , 'active' ) ;
105110
106111 // <ds-item-relationships> tag must be loaded
@@ -114,9 +119,11 @@ describe('Edit Item > Relationships tab', () => {
114119describe ( 'Edit Item > Version History tab' , ( ) => {
115120
116121 it ( 'should pass accessibility tests' , ( ) => {
122+ cy . get ( 'a[data-test="versionhistory"]' ) . should ( 'be.visible' ) ;
117123 cy . get ( 'a[data-test="versionhistory"]' ) . click ( ) ;
118124
119- // Our selected tab should be active
125+ // Our selected tab should be both visible & active
126+ cy . get ( 'a[data-test="versionhistory"]' ) . should ( 'be.visible' ) ;
120127 cy . get ( 'a[data-test="versionhistory"]' ) . should ( 'have.class' , 'active' ) ;
121128
122129 // <ds-item-version-history> tag must be loaded
@@ -130,9 +137,11 @@ describe('Edit Item > Version History tab', () => {
130137describe ( 'Edit Item > Access Control tab' , ( ) => {
131138
132139 it ( 'should pass accessibility tests' , ( ) => {
140+ cy . get ( 'a[data-test="access-control"]' ) . should ( 'be.visible' ) ;
133141 cy . get ( 'a[data-test="access-control"]' ) . click ( ) ;
134142
135- // Our selected tab should be active
143+ // Our selected tab should be both visible & active
144+ cy . get ( 'a[data-test="access-control"]' ) . should ( 'be.visible' ) ;
136145 cy . get ( 'a[data-test="access-control"]' ) . should ( 'have.class' , 'active' ) ;
137146
138147 // <ds-item-access-control> tag must be loaded
@@ -146,9 +155,11 @@ describe('Edit Item > Access Control tab', () => {
146155describe ( 'Edit Item > Collection Mapper tab' , ( ) => {
147156
148157 it ( 'should pass accessibility tests' , ( ) => {
158+ cy . get ( 'a[data-test="mapper"]' ) . should ( 'be.visible' ) ;
149159 cy . get ( 'a[data-test="mapper"]' ) . click ( ) ;
150160
151- // Our selected tab should be active
161+ // Our selected tab should be both visible & active
162+ cy . get ( 'a[data-test="mapper"]' ) . should ( 'be.visible' ) ;
152163 cy . get ( 'a[data-test="mapper"]' ) . should ( 'have.class' , 'active' ) ;
153164
154165 // <ds-item-collection-mapper> tag must be loaded
0 commit comments