diff --git a/tests/cypress/integration/home.cy.js b/tests/cypress/integration/home.cy.js
index 9bd0e12e9..1927225b6 100644
--- a/tests/cypress/integration/home.cy.js
+++ b/tests/cypress/integration/home.cy.js
@@ -1,16 +1,19 @@
//
describe('Home Page', function () {
+ let NewfoldRuntime;
before(() => {
cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/home');
+ cy.window().its('NewfoldRuntime').then(data => {
+ NewfoldRuntime = data;
+ });
cy.injectAxe();
-
});
it('Site Info Exists', () => {
cy
- .get('.wppbh-app-site-info').contains('h3', 'bluehost-wordpress-plugin')
+ .get('.wppbh-app-site-info').contains('h3', NewfoldRuntime.site.title)
.scrollIntoView()
.should('be.visible');
});
@@ -27,7 +30,7 @@ describe('Home Page', function () {
.should('be.visible');
});
- it('Additional Features Section Exists', () => {
+ it.skip('Additional Features Section Exists', () => {
cy
.get('.nfd-app-section-container').contains('h2', 'Additional Features')
.scrollIntoView()
diff --git a/tests/cypress/integration/navigation.cy.js b/tests/cypress/integration/navigation.cy.js
index 89237d861..c34e1c580 100644
--- a/tests/cypress/integration/navigation.cy.js
+++ b/tests/cypress/integration/navigation.cy.js
@@ -8,21 +8,17 @@ describe('Navigation', function () {
});
+ it('Admin submenu shouldn\'t exist inside app', () => {
+ cy
+ .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu')
+ .should('not.exist');
+ });
+
it('Logo Links to home', () => {
cy.get('.wppbh-logo-wrap').click();
cy.wait(500);
cy.hash().should('eq', '#/home');
});
-
- it('Admin Subnav properly highlights', () => {
- cy
- .get('#adminmenu #toplevel_page_bluehost')
- .should('have.class', 'wp-has-current-submenu');
- cy
- .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
- .should('have.attr', 'href')
- .and('match', /home/);
- });
// test main nav
it('Main nav links properly navigates', () => {
@@ -35,10 +31,6 @@ describe('Navigation', function () {
cy
.get('.wppbh-app-navitem-Marketplace')
.should('have.class', 'active');
- cy
- .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
- .should('have.attr', 'href')
- .and('match', /marketplace/);
cy.get('.wppbh-app-navitem-Performance').click();
cy.wait(500);
@@ -49,18 +41,10 @@ describe('Navigation', function () {
cy
.get('.wppbh-app-navitem-Marketplace')
.should('not.have.class', 'active');
- cy
- .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
- .should('have.attr', 'href')
- .and('match', /performance/);
cy.get('.wppbh-app-navitem-Settings').click();
cy.wait(500);
cy.hash().should('eq', '#/settings');
- cy
- .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
- .should('have.attr', 'href')
- .and('match', /settings/);
});
it('Subnav links properly navigates', () => {
@@ -76,10 +60,6 @@ describe('Navigation', function () {
cy
.get('.wppbh-app-navitem-Marketplace')
.should('have.class', 'active');
- cy
- .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
- .should('have.attr', 'href')
- .and('match', /marketplace/);
cy.get('.wppbh-app-subnavitem-Services').click();
cy.wait(500);
@@ -87,10 +67,6 @@ describe('Navigation', function () {
cy
.get('.wppbh-app-subnavitem-Services')
.should('have.class', 'active');
- cy
- .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
- .should('have.attr', 'href')
- .and('match', /marketplace/);
cy
.get('.wppbh-app-navitem-Marketplace')
.should('have.class', 'active');
@@ -105,14 +81,10 @@ describe('Navigation', function () {
cy
.get('.wppbh-app-subnavitem-Services')
.should('not.have.class', 'active');
- cy
- .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li.current a')
- .should('have.attr', 'href')
- .and('match', /marketplace/);
cy
.get('.wppbh-app-navitem-Marketplace')
.should('have.class', 'active');
-
+
cy.get('.wppbh-app-navitem-Performance').click();
cy.wait(500);
cy
@@ -126,6 +98,22 @@ describe('Navigation', function () {
.should('not.have.class', 'active');
});
+ it('Admin submenu exist outside the app', () => {
+ cy.visit('/wp-admin/index.php');
+ cy
+ .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu')
+ .should('exist');
+ cy
+ .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/home"]')
+ .should('exist');
+ cy
+ .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/marketplace"]')
+ .should('exist');
+ cy
+ .get('#adminmenu #toplevel_page_bluehost ul.wp-submenu li a[href="admin.php?page=bluehost#/settings"]')
+ .should('exist');
+ });
+
// utility nav is no more, leaving this in place un case we bring it back anytime soon.
it.skip('Utility nav links properly navigates', () => {
cy