File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ /// <reference types="cypress" />
2+
3+ const userRoles = [
4+ 'admin' ,
5+ 'editor' ,
6+ 'subscriber' ,
7+ 'contributor' ,
8+ 'author' ,
9+ ]
10+
11+ describe ( 'All users can access the release notes page' , ( ) => {
12+
13+ userRoles . forEach ( ( role ) => {
14+
15+ describe ( `${ role } access` , ( ) => {
16+ beforeEach ( ( ) => {
17+ cy . switchUser ( role ) ;
18+ cy . visit ( '/admin/' ) ;
19+ } )
20+
21+ it ( `should allow ${ role } to see the release notes page` , ( ) => {
22+ cy . get ( '#toplevel_page_release-notes > .wp-not-current-submenu > .wp-menu-name' ) . contains ( 'Release Notes' ) . should ( 'exist' ) ;
23+ cy . get ( '#toplevel_page_release-notes > .wp-not-current-submenu > .wp-menu-name' ) . click ( ) ;
24+ cy . url ( ) . should ( 'eq' , Cypress . config ( ) . baseUrl + '/wp-admin/admin.php?page=release-notes' ) ;
25+ cy . url ( ) . should ( 'contain' , 'release-notes' ) ;
26+ } )
27+ } )
28+
29+ } )
30+
31+ } )
32+
You can’t perform that action at this time.
0 commit comments