Skip to content

Commit

Permalink
Update/cypress (#57)
Browse files Browse the repository at this point in the history
* Release/1.2.5 (#54)

* Update GitHub workflows (#32)

* Clear Cloudflare cache for plugin update API after deleting a release

* Add version check to release workflow

* Clear Cloudflare cache for plugin update API after a release is ready

* add the package version number to version checks

* sync workflow edits from bhp

* set composer config to php7

* npm updates for node 16

* fix yaml lint errors

* pass required router methods to marketplace component

* fix marketplace test and add deep link test

Co-authored-by: Evan Mullins <evanrm@gmail.com>

* Update marketplace styles (#34)

* Update marketplace styles

* horizontal tabpanel filter bar.

* 3 card wide layout.

* other style improvements.

* price pill borders update

add parallelogram shape to the price pill

* Add the SSO module to the HostGator plugin (#38)

* package updates (#42)

update to latest cypress, wp-env, react-router-dom, testing-library/cypress, cypress-axe
also migrate cypress config and tests for latest version

* Use wp-forge / wp-upgrade-handler package (#44)

Replace UpgradeHandler class with forge package that does the same thing.

Fixes issue #30

Co-authored-by: Evan Mullins <evanrm@gmail.com>

* add newfold secure passwords module (#45)

* Add newfold-labs/wp-module-notifications (#46)

* Add newfold-labs/wp-module-notifications

Adding the notification module to the plugin (won't be used for now).

Fix #39

* Fix composer.json / .lock conflicts

* Add Notifications component to plugin's the React app

Reference:  #46 (comment)

* updates for hostgator

update window object and context
set up the missing vars that are being passed in: filter and hashedPath

Co-authored-by: Evan Mullins <evanrm@gmail.com>

* Add/spanish translations (#52)

* add translation files for es_MX

* force all Spanish languages to use plugin translations for MX

* use new wrapper method to clean up locale overrides

* lint fixes

* adding region links for MX CL and CO locales

* break out the locale_overrides static function for clarity

* swap out the bluehost wp-php-standards for newfold replacement

* update phpcs ruleset names

* Update to make sure PHPCS dependencies are properly installed

Co-authored-by: Micah Wood <micah@wpscholar.com>

* version bump

* update package lock file

* i18n update to add a couple missing strings and translation for MX and BR

Co-authored-by: Micah Wood <micah@wpscholar.com>
Co-authored-by: A. Alani <38976631+aalani95@users.noreply.github.com>

* update cypress package and tests for compatability

* tweak tests

---------

Co-authored-by: Micah Wood <micah@wpscholar.com>
Co-authored-by: A. Alani <38976631+aalani95@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 1, 2023
1 parent 7cf4bdb commit 72da84b
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 86 deletions.
6 changes: 4 additions & 2 deletions .wp-env.json
@@ -1,10 +1,12 @@
{
"core": "WordPress/WordPress#tags/6.0",
"core": "WordPress/WordPress#tags/6.1.1",
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
"WP_DEBUG_DISPLAY": true
"WP_DEBUG_DISPLAY": false,
"FS_METHOD": "direct"
},
"phpVersion": "8.1",
"plugins": [
"."
],
Expand Down
8 changes: 8 additions & 0 deletions cypress.config.js
Expand Up @@ -11,6 +11,13 @@ module.exports = defineConfig({
videosFolder: 'tests/cypress/videos',
videoUploadOnPasses: false,
chromeWebSecurity: false,
viewportWidth: 1024,
viewportHeight: 768,
blockHosts: [
'*doubleclick.net',
'*jnn-pa.googleapis.com',
'*youtube.com',
],
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
Expand All @@ -20,5 +27,6 @@ module.exports = defineConfig({
baseUrl: 'http://localhost:8880',
specPattern: 'tests/cypress/integration/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'tests/cypress/support/index.js',
testIsolation: false,
},
})
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -10,11 +10,11 @@
},
"devDependencies": {
"@automattic/babel-plugin-preserve-i18n": "^1.0.0",
"@testing-library/cypress": "^8.0.3",
"@testing-library/cypress": "^9.0.0",
"@wordpress/env": "^5.3.0",
"@wordpress/scripts": "^19.2.2",
"cypress": "^10.8.0",
"cypress-axe": "^1.0.0",
"cypress": "^12.4.1",
"cypress-axe": "1.3",
"node-wp-i18n": "^1.2.6"
},
"scripts": {
Expand Down
50 changes: 24 additions & 26 deletions tests/cypress/integration/coming-soon.cy.js
Expand Up @@ -13,13 +13,11 @@ describe('Coming Soon', function () {
cy.get('.coming-soon-toggle input[type="checkbox"]').uncheck();
cy.get('.coming-soon-toggle input[type="checkbox"]').check();
cy.wait(100);
cy
.get('.edit-site-notices .components-snackbar__content')
cy.get('.edit-site-notices .components-snackbar__content')
.contains('div', 'Coming soon activated')
.should('be.visible');

cy
.get('.coming-soon-protip .accordion-summary')
cy.get('.coming-soon-protip .accordion-summary')
.contains('p', 'Pro Tip')
.should('be.visible');
cy.get('.coming-soon-protip').should('not.have.attr', 'open');
Expand All @@ -31,8 +29,7 @@ describe('Coming Soon', function () {

it('Has Coming Soon Section on Home', () => {
cy.visit('/wp-admin/admin.php?page=hostgator#/home');
cy
.get('.hgwp-section-coming-soon')
cy.get('.hgwp-section-coming-soon')
.scrollIntoView()
.contains('h3', 'Coming Soon')
.should('be.visible');
Expand All @@ -41,16 +38,14 @@ describe('Coming Soon', function () {

it('Has Coming Soon in Admin Toolbar', () => {
cy.reload();
cy
.get('#wp-toolbar #wp-admin-bar-hostgator-coming_soon')
cy.get('#wp-toolbar #wp-admin-bar-hostgator-coming_soon')
.contains('div', 'Coming Soon Active')
.should('be.visible');
});

it('Displays admin coming soon notice', () => {
cy.visit('/wp-admin/index.php');
cy
.get('.notice-warning')
cy.get('.notice-warning')
.contains('p', 'coming')
.should('be.visible');
});
Expand All @@ -59,62 +54,65 @@ describe('Coming Soon', function () {
cy.visit('/wp-admin/admin.php?page=hostgator#/home');
cy.get('.hgwp-section-coming-soon button.is-primary').click();
cy.wait(500);
cy
.get('#wp-toolbar #wp-admin-bar-hostgator-coming_soon')
cy.get('#wp-toolbar #wp-admin-bar-hostgator-coming_soon')
.contains('div', 'Coming Soon Active')
.should('not.be.visible');

cy
.get('.hgwp-section-coming-soon')
cy.get('.hgwp-section-coming-soon')
.scrollIntoView()
.contains('h3', 'Site Launched')
.should('be.visible');

cy.get('.hgwp-section-coming-soon button.is-secondary').click();


cy
.get('.hgwp-section-coming-soon')
cy.get('.hgwp-section-coming-soon')
.scrollIntoView()
.contains('h3', 'Coming Soon')
.should('be.visible');
});

it('Displays Coming Soon on Frontend', () => {
cy.get('#wp-admin-bar-logout a').click({ force: true });
cy.logout();
// cy.get('#wp-admin-bar-logout a').click({ force: true });
cy.visit('/');
cy
.get('body')
cy.get('body')
.contains('h2', 'Coming Soon')
.should('be.visible');
});

it('Coming soon page is Accessible', () => {
cy.injectAxe();
cy.wait(500);
cy.checkA11y('body');
});

it('Launching launches site', () => {
cy.login(Cypress.env('wpUsername'), Cypress.env('wpPassword'));
cy.visit('/wp-admin/admin.php?page=hostgator#/settings');
cy.get('.coming-soon-toggle input[type="checkbox"]').should('be.checked');

cy.visit('/wp-admin/admin.php?page=hostgator#/home');
cy
.get('.hgwp-section-coming-soon')
cy.get('.hgwp-section-coming-soon')
.scrollIntoView()
.contains('h3', 'Coming Soon')
.should('be.visible');

cy.get('.hgwp-section-coming-soon button.is-primary').click();
cy.get('.hgwp-section-coming-soon button.is-link').click(); //dismiss

cy
.get('.hgwp-section-coming-soon')
cy.get('.hgwp-section-coming-soon')
.should('not.exist');

cy.get('#wp-admin-bar-logout a').click({ force: true });
cy.logout();
// cy.get('#wp-admin-bar-logout a').click({ force: true });
cy.visit('/');
cy
.get('body')

cy.get('body')
.contains('h2', 'Coming Soon')
.should('not.exist');

cy.login(Cypress.env('wpUsername'), Cypress.env('wpPassword'));
cy.visit('/wp-admin/admin.php?page=hostgator#/settings');
})
});
28 changes: 11 additions & 17 deletions tests/cypress/integration/help.cy.js
Expand Up @@ -4,54 +4,48 @@ describe('Help Page', function () {

before(() => {
cy.visit('/wp-admin/admin.php?page=hostgator#/help');
cy.injectAxe();

});

it('Is Accessible', () => {
cy.injectAxe();
cy.wait(500);
cy.checkA11y('.hgwp-app-body');
});

it('Phone Card Exists', () => {
cy
.get('.card-help-phone').contains('h3', 'Phone')
cy.get('.card-help-phone').contains('h3', 'Phone')
.scrollIntoView()
.should('be.visible');
});

it('Chat Card Exists', () => {
cy
.get('.card-help-chat').contains('h3', 'Chat')
cy.get('.card-help-chat').contains('h3', 'Chat')
.scrollIntoView()
.should('be.visible');
});

it('Tweet Card Exists', () => {
cy
.get('.card-help-twitter').contains('h3', 'Tweet')
cy.get('.card-help-twitter').contains('h3', 'Tweet')
.scrollIntoView()
.should('be.visible');
});

it('KB Card Exists', () => {
cy
.get('.card-help-kb').contains('h3', 'Knowledge Base')
cy.get('.card-help-kb').contains('h3', 'Knowledge Base')
.scrollIntoView()
.should('be.visible');
});

it('Blog Card Exists', () => {
cy
.get('.card-help-blog').contains('h3', 'Blog')
cy.get('.card-help-blog').contains('h3', 'Blog')
.scrollIntoView()
.should('be.visible');
});

it('Youtube Card Exists', () => {
cy
.get('.card-help-video').contains('h3', 'Video')
cy.get('.card-help-video').contains('h3', 'Video')
.scrollIntoView()
.should('be.visible');
});



});

0 comments on commit 72da84b

Please sign in to comment.