Skip to content

Commit 022318a

Browse files
authored
Merge pull request #10 from bigbite/feature/access-to-release-notes-page
[4] All users can access release notes page test
2 parents eb40d37 + 3192f1e commit 022318a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+

0 commit comments

Comments
 (0)