diff --git a/.github/workflows/cypress-matrix.yml b/.github/workflows/cypress-matrix.yml index b251d18c9..e35080bdd 100644 --- a/.github/workflows/cypress-matrix.yml +++ b/.github/workflows/cypress-matrix.yml @@ -37,7 +37,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/cypress-tests-beta.yml b/.github/workflows/cypress-tests-beta.yml index d3835d8f3..224774b1f 100644 --- a/.github/workflows/cypress-tests-beta.yml +++ b/.github/workflows/cypress-tests-beta.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index dd1951167..95cd9f11c 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 697910d14..80768712c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # User PHP 7.4 here for compatibility with the WordPress codesniffer rules. - name: Setup PHP diff --git a/.github/workflows/upload-artifact-on-push.yml b/.github/workflows/upload-artifact-on-push.yml index 35f96f9e4..9d25c39b0 100644 --- a/.github/workflows/upload-artifact-on-push.yml +++ b/.github/workflows/upload-artifact-on-push.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Validate version number if: ${{ (github.repository == 'bluehost/bluehost-wordpress-plugin') }} diff --git a/.github/workflows/upload-asset-on-release.yml b/.github/workflows/upload-asset-on-release.yml index 4848e6ca5..64eab2231 100644 --- a/.github/workflows/upload-asset-on-release.yml +++ b/.github/workflows/upload-asset-on-release.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Validate version number if: ${{ (github.repository == 'bluehost/bluehost-wordpress-plugin') && (github.event.release.prerelease == false) }} diff --git a/bootstrap.php b/bootstrap.php index 330f484bc..400d36628 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -204,6 +204,7 @@ function () { require BLUEHOST_PLUGIN_DIR . '/inc/RestApi/rest-api.php'; require BLUEHOST_PLUGIN_DIR . '/inc/settings.php'; require BLUEHOST_PLUGIN_DIR . '/inc/updates.php'; +require BLUEHOST_PLUGIN_DIR . '/inc/YoastAI.php'; /* WordPress Admin Page & Features */ if ( is_admin() ) { diff --git a/composer.json b/composer.json index a8007b76d..dbc5f03b9 100644 --- a/composer.json +++ b/composer.json @@ -56,18 +56,18 @@ }, "require": { "newfold-labs/wp-module-business-reviews": "^1.1.1", - "newfold-labs/wp-module-coming-soon": "^1.1.8", + "newfold-labs/wp-module-coming-soon": "^1.1.9", "newfold-labs/wp-module-ctb": "^1.0.2", "newfold-labs/wp-module-customer-bluehost": "^1.6.0", "newfold-labs/wp-module-data": "^2.4.3", - "newfold-labs/wp-module-ecommerce": "^1.2.0", + "newfold-labs/wp-module-ecommerce": "^1.2.3", "newfold-labs/wp-module-help-center": "^1.0.16", "newfold-labs/wp-module-loader": "^1.0.10", "newfold-labs/wp-module-marketplace": "^2.0.1", "newfold-labs/wp-module-notifications": "^1.1.4", - "newfold-labs/wp-module-onboarding": "^1.10.2", + "newfold-labs/wp-module-onboarding": "^1.10.3", "newfold-labs/wp-module-patterns": "^0.1.4", - "newfold-labs/wp-module-performance": "^1.1.1", + "newfold-labs/wp-module-performance": "^1.2.0", "newfold-labs/wp-module-runtime": "^1.0.2", "newfold-labs/wp-module-secure-passwords": "^1.1", "newfold-labs/wp-module-sso": "^1.0.4", diff --git a/composer.lock b/composer.lock index be29c340a..419097dc6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1ae45d85b26a7a105206d2be53da8a79", + "content-hash": "d5d82a728d23e08b00cd1c9413a764e3", "packages": [ { "name": "doctrine/inflector", @@ -272,16 +272,16 @@ }, { "name": "newfold-labs/wp-module-coming-soon", - "version": "1.1.8", + "version": "1.1.9", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-coming-soon.git", - "reference": "a15468920ca6828cfdd32f16fd111fe13fece15c" + "reference": "796ec3c20a0d023f18704f6147ce505c6460af7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-coming-soon/zipball/a15468920ca6828cfdd32f16fd111fe13fece15c", - "reference": "a15468920ca6828cfdd32f16fd111fe13fece15c", + "url": "https://api.github.com/repos/newfold-labs/wp-module-coming-soon/zipball/796ec3c20a0d023f18704f6147ce505c6460af7c", + "reference": "796ec3c20a0d023f18704f6147ce505c6460af7c", "shasum": "" }, "require-dev": { @@ -315,10 +315,10 @@ ], "description": "Coming Soon module for WordPress sites.", "support": { - "source": "https://github.com/newfold-labs/wp-module-coming-soon/tree/1.1.8", + "source": "https://github.com/newfold-labs/wp-module-coming-soon/tree/1.1.9", "issues": "https://github.com/newfold-labs/wp-module-coming-soon/issues" }, - "time": "2023-08-21T17:43:22+00:00" + "time": "2023-09-06T19:45:39+00:00" }, { "name": "newfold-labs/wp-module-ctb", @@ -467,16 +467,16 @@ }, { "name": "newfold-labs/wp-module-ecommerce", - "version": "v1.2.0", + "version": "v1.2.3", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-ecommerce.git", - "reference": "a8eabc3a10e69bc21bc43af7484207f4cd273d90" + "reference": "9a6fa36362c5e26fa21df83f6fea299732a0d5d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-ecommerce/zipball/a8eabc3a10e69bc21bc43af7484207f4cd273d90", - "reference": "a8eabc3a10e69bc21bc43af7484207f4cd273d90", + "url": "https://api.github.com/repos/newfold-labs/wp-module-ecommerce/zipball/9a6fa36362c5e26fa21df83f6fea299732a0d5d3", + "reference": "9a6fa36362c5e26fa21df83f6fea299732a0d5d3", "shasum": "" }, "require": { @@ -518,10 +518,10 @@ ], "description": "Brand Agnostic eCommerce Experience", "support": { - "source": "https://github.com/newfold-labs/wp-module-ecommerce/tree/v1.2.0", + "source": "https://github.com/newfold-labs/wp-module-ecommerce/tree/v1.2.3", "issues": "https://github.com/newfold-labs/wp-module-ecommerce/issues" }, - "time": "2023-08-29T20:48:08+00:00" + "time": "2023-09-12T10:56:18+00:00" }, { "name": "newfold-labs/wp-module-help-center", @@ -761,16 +761,16 @@ }, { "name": "newfold-labs/wp-module-onboarding", - "version": "1.10.2", + "version": "1.10.3", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-onboarding.git", - "reference": "ec63cfa68ddc94f4dd04746ff9d2a0a8f96c16c6" + "reference": "975ea5d51f0e3a40c37c8481466c28876fcd322d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-onboarding/zipball/ec63cfa68ddc94f4dd04746ff9d2a0a8f96c16c6", - "reference": "ec63cfa68ddc94f4dd04746ff9d2a0a8f96c16c6", + "url": "https://api.github.com/repos/newfold-labs/wp-module-onboarding/zipball/975ea5d51f0e3a40c37c8481466c28876fcd322d", + "reference": "975ea5d51f0e3a40c37c8481466c28876fcd322d", "shasum": "" }, "require": { @@ -813,10 +813,10 @@ ], "description": "Next-generation WordPress Onboarding for WordPress sites at Newfold Digital.", "support": { - "source": "https://github.com/newfold-labs/wp-module-onboarding/tree/1.10.2", + "source": "https://github.com/newfold-labs/wp-module-onboarding/tree/1.10.3", "issues": "https://github.com/newfold-labs/wp-module-onboarding/issues" }, - "time": "2023-08-28T12:26:03+00:00" + "time": "2023-09-11T08:13:27+00:00" }, { "name": "newfold-labs/wp-module-patterns", @@ -870,16 +870,16 @@ }, { "name": "newfold-labs/wp-module-performance", - "version": "1.1.1", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-performance.git", - "reference": "7efc4f25a9e576d6aae79f9e3472630bc8e46fcd" + "reference": "b341bb7dbdf6a5b9038d670deffc5df1f2029973" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-performance/zipball/7efc4f25a9e576d6aae79f9e3472630bc8e46fcd", - "reference": "7efc4f25a9e576d6aae79f9e3472630bc8e46fcd", + "url": "https://api.github.com/repos/newfold-labs/wp-module-performance/zipball/b341bb7dbdf6a5b9038d670deffc5df1f2029973", + "reference": "b341bb7dbdf6a5b9038d670deffc5df1f2029973", "shasum": "" }, "require": { @@ -908,23 +908,23 @@ ], "description": "A module for managing caching functionality.", "support": { - "source": "https://github.com/newfold-labs/wp-module-performance/tree/1.1.1", + "source": "https://github.com/newfold-labs/wp-module-performance/tree/1.2.1", "issues": "https://github.com/newfold-labs/wp-module-performance/issues" }, - "time": "2023-06-12T11:20:05+00:00" + "time": "2023-09-11T18:50:56+00:00" }, { "name": "newfold-labs/wp-module-runtime", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-runtime.git", - "reference": "5c1081fc3ba3f0cc047351578c9c205f0d4c304c" + "reference": "9de4f765c12194c7356c2fbaf8182a56d9ba4433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-runtime/zipball/5c1081fc3ba3f0cc047351578c9c205f0d4c304c", - "reference": "5c1081fc3ba3f0cc047351578c9c205f0d4c304c", + "url": "https://api.github.com/repos/newfold-labs/wp-module-runtime/zipball/9de4f765c12194c7356c2fbaf8182a56d9ba4433", + "reference": "9de4f765c12194c7356c2fbaf8182a56d9ba4433", "shasum": "" }, "require-dev": { @@ -960,10 +960,10 @@ ], "description": "Runtime for Newfold WP modules and plugins", "support": { - "source": "https://github.com/newfold-labs/wp-module-runtime/tree/v1.0.2", + "source": "https://github.com/newfold-labs/wp-module-runtime/tree/v1.0.3", "issues": "https://github.com/newfold-labs/wp-module-runtime/issues" }, - "time": "2023-08-03T17:28:47+00:00" + "time": "2023-09-12T09:39:39+00:00" }, { "name": "newfold-labs/wp-module-secure-passwords", @@ -2203,12 +2203,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "05cbd34d3f34203a5be403e69e1fc9fef70d546a" + "reference": "6cbe3472c940a80f587886423020673520d36a29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/05cbd34d3f34203a5be403e69e1fc9fef70d546a", - "reference": "05cbd34d3f34203a5be403e69e1fc9fef70d546a", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/6cbe3472c940a80f587886423020673520d36a29", + "reference": "6cbe3472c940a80f587886423020673520d36a29", "shasum": "" }, "conflict": { @@ -2265,7 +2265,7 @@ "brotkrueml/schema": "<1.13.1|>=2,<2.5.1", "brotkrueml/typo3-matomo-integration": "<1.3.2", "buddypress/buddypress": "<7.2.1", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "bugsnag/bugsnag-laravel": "<2.0.2", "bytefury/crater": "<6.0.2", "cachethq/cachet": "<2.5.1", "cakephp/cakephp": "<3.10.3|>=4,<4.0.10|>=4.1,<4.1.4|>=4.2,<4.2.12|>=4.3,<4.3.11|>=4.4,<4.4.10", @@ -2319,7 +2319,7 @@ "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", "dolibarr/dolibarr": "<17.0.1", "dompdf/dompdf": "<2.0.2|==2.0.2", - "drupal/core": ">=7,<7.96|>=8,<9.4.14|>=9.5,<9.5.8|>=10,<10.0.8", + "drupal/core": "<9.4.14|>=9.5,<9.5.8|>=10,<10.0.8", "drupal/drupal": ">=6,<6.38|>=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4", "dweeves/magmi": "<=0.7.24", "ecodev/newsletter": "<=4", @@ -2451,7 +2451,7 @@ "kimai/kimai": "<1.1", "kitodo/presentation": "<3.2.3|>=3.3,<3.3.4", "klaviyo/magento2-extension": ">=1,<3", - "knplabs/knp-snappy": "<1.4.2", + "knplabs/knp-snappy": "<=1.4.2", "kohana/core": "<3.3.3", "krayin/laravel-crm": "<1.2.2", "kreait/firebase-php": ">=3.2,<3.8.1", @@ -2499,6 +2499,7 @@ "mobiledetect/mobiledetectlib": "<2.8.32", "modx/revolution": "<=2.8.3.0-patch", "mojo42/jirafeau": "<4.4", + "mongodb/mongodb": ">=1,<1.9.2", "monolog/monolog": ">=1.8,<1.12", "moodle/moodle": "<4.2.0.0-RC2-dev|==4.2", "movim/moxl": ">=0.8,<=0.10", @@ -2531,7 +2532,7 @@ "open-web-analytics/open-web-analytics": "<1.7.4", "opencart/opencart": "<=3.0.3.7", "openid/php-openid": "<2.3", - "openmage/magento-lts": "<19.4.22|>=20,<20.0.19", + "openmage/magento-lts": "<=19.5|>=20,<=20.1", "opensource-workshop/connect-cms": "<1.7.2|>=2,<2.3.2", "orchid/platform": ">=9,<9.4.4|>=14.0.0.0-alpha4,<14.5", "oro/commerce": ">=4.1,<5.0.6", @@ -2707,6 +2708,7 @@ "symfony/serializer": ">=2,<2.0.11|>=4.1,<4.4.35|>=5,<5.3.12", "symfony/symfony": "<4.4.50|>=5,<5.4.20|>=6,<6.0.20|>=6.1,<6.1.12|>=6.2,<6.2.6", "symfony/translation": ">=2,<2.0.17", + "symfony/ux-autocomplete": "<2.11.2", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", @@ -2748,6 +2750,7 @@ "typo3/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", "typo3fluid/fluid": ">=2,<2.0.8|>=2.1,<2.1.7|>=2.2,<2.2.4|>=2.3,<2.3.7|>=2.4,<2.4.4|>=2.5,<2.5.11|>=2.6,<2.6.10", "ua-parser/uap-php": "<3.8", + "uasoft-indonesia/badaso": "<=2.9.7", "unisharp/laravel-filemanager": "<=2.5.1", "userfrosting/userfrosting": ">=0.3.1,<4.6.3", "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", @@ -2859,7 +2862,7 @@ "type": "tidelift" } ], - "time": "2023-08-29T19:04:20+00:00" + "time": "2023-09-11T21:04:03+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3293,7 +3296,7 @@ }, { "name": "wp-phpunit/wp-phpunit", - "version": "6.3.0", + "version": "6.3.1", "source": { "type": "git", "url": "https://github.com/wp-phpunit/wp-phpunit.git", diff --git a/cypress.config.js b/cypress.config.js index 73d711671..f448ff9e3 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -51,7 +51,7 @@ module.exports = defineConfig({ if (semver.satisfies(config.env.wpSemverVersion, '<6.2.0')) { config.excludeSpecPattern = config.excludeSpecPattern.concat( [ - "tests/cypress/integration/z-newfold-labs/wp-module-onboarding/**" + "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/**" ] ); } @@ -68,8 +68,8 @@ module.exports = defineConfig({ if (semver.satisfies(config.env.phpSemverVersion, '<7.3.0')) { config.excludeSpecPattern = config.excludeSpecPattern.concat( [ - "tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/**", - "tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/top-priority.cy.js" + "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/3-ecommerce-onboarding-flow/**", + "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js" ] ); } @@ -84,8 +84,8 @@ module.exports = defineConfig({ supportFile: 'tests/cypress/support/index.js', testIsolation: false, excludeSpecPattern: [ - "tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/**", - "tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/" + "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/4-design-steps/**", + "vendor/newfold-labs/wp-module-onboarding/tests/cypress/integration/wp-module-support/" ] }, }) diff --git a/inc/Admin.php b/inc/Admin.php index e268f77d4..e090beef9 100644 --- a/inc/Admin.php +++ b/inc/Admin.php @@ -35,7 +35,7 @@ public function __construct() { } public static function add_to_runtime( $sdk ) { - include BLUEHOST_PLUGIN_DIR . '/inc/Data.php'; + include_once BLUEHOST_PLUGIN_DIR . '/inc/Data.php'; return array_merge( $sdk, Data::runtime() ); } diff --git a/inc/YoastAI.php b/inc/YoastAI.php new file mode 100644 index 000000000..f16dc2541 --- /dev/null +++ b/inc/YoastAI.php @@ -0,0 +1,65 @@ +helpers->options->get( 'enable_ai_generator', null ) !== null ) { + yoastseo()->helpers->options->set( 'enable_ai_generator', true ); + } +} diff --git a/package-lock.json b/package-lock.json index cd39120f9..c8ca133b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,12 +5,11 @@ "requires": true, "packages": { "": { - "name": "bluehost-wordpress-plugin", "version": "3.1.0", "license": "GPL-2.0-or-later", "dependencies": { "@heroicons/react": "^2.0.18", - "@newfold-labs/wp-module-ecommerce": "^1.2.0", + "@newfold-labs/wp-module-ecommerce": "^1.2.2", "@newfold-labs/wp-module-runtime": "^1.0.2", "@newfold/ui-component-library": "^1.0.0", "@reduxjs/toolkit": "^1.9.5", @@ -3038,9 +3037,9 @@ "integrity": "sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A==" }, "node_modules/@newfold-labs/wp-module-ecommerce": { - "version": "1.2.0", - "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.2.0/cb892c3fc98fa2a489871a39bb5dc5d0d956908f", - "integrity": "sha512-NnhrB9oe13+0nbID9660c/Xlj6F0A/ybtfn19K1GMTgdDOndtdvZCNIwxehhAkqgqggtnSzKYaRy+WW503Y3aA==", + "version": "1.2.2", + "resolved": "https://npm.pkg.github.com/download/@newfold-labs/wp-module-ecommerce/1.2.2/b966e441a24cc08ec80e962ac5860eada360e29c", + "integrity": "sha512-x1KBQTWtOKLF8GiWvXH+AxpCOyjeqeDTAje3IEmMZUBreKzCxyvLLLslF7kjIGaw9mog13qy0PJQh2Xt6whcjA==", "license": "GPL-2.0-or-later", "dependencies": { "@faizaanceg/pandora": "^1.1.1", diff --git a/package.json b/package.json index ac0a82b24..7e0951901 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@heroicons/react": "^2.0.18", - "@newfold-labs/wp-module-ecommerce": "^1.2.0", + "@newfold-labs/wp-module-ecommerce": "^1.2.2", "@newfold-labs/wp-module-runtime": "^1.0.2", "@newfold/ui-component-library": "^1.0.0", "@reduxjs/toolkit": "^1.9.5", diff --git a/src/app/pages/performance/index.js b/src/app/pages/performance/index.js index 475286cf7..3a4f7ec34 100644 --- a/src/app/pages/performance/index.js +++ b/src/app/pages/performance/index.js @@ -1,8 +1,48 @@ -import Performance from './performance'; +import AppStore from '../../data/store'; import { Page } from '../../components/page'; -import { SectionContainer, SectionHeader, SectionContent } from '../../components/section'; +import { useState, useEffect, useContext, Fragment } from '@wordpress/element'; +import apiFetch from '@wordpress/api-fetch'; +import classnames from 'classnames'; +import { useUpdateEffect } from 'react-use'; +import { NewfoldRuntime } from "@newfold-labs/wp-module-runtime"; +import { SectionContainer, SectionHeader, SectionContent, SectionSettings } from '../../components/section'; +import { useNotification } from '../../components/notifications/feed'; +import { + bluehostSettingsApiFetch as newfoldSettingsApiFetch, + bluehostPurgeCacheApiFetch as newfoldPurgeCacheApiFetch +} from '../../util/helpers'; + +import { default as NewfoldPerformance } from '../../../../vendor/newfold-labs/wp-module-performance/components/performance/'; const PerformancePage = () => { + + // constants to pass to module + const moduleConstants = {}; + + // methods to pass to module + const moduleMethods = { + apiFetch, + classnames, + useState, + useEffect, + useContext, + NewfoldRuntime, + useNotification, + newfoldSettingsApiFetch, + newfoldPurgeCacheApiFetch, + useUpdateEffect, + AppStore, + }; + + const moduleComponents = { + Page, + SectionHeader, + SectionContent, + SectionSettings, + SectionContainer, + Fragment, + } + return ( @@ -11,11 +51,11 @@ const PerformancePage = () => { subTitle={__('This is where you can manage cache settings for your website.', 'wp-plugin-bluehost')} className={'wppbh-app-settings-header'} /> - - - - - + ); diff --git a/src/app/pages/performance/performance.js b/src/app/pages/performance/performance.js deleted file mode 100644 index c092fe572..000000000 --- a/src/app/pages/performance/performance.js +++ /dev/null @@ -1,187 +0,0 @@ -import AppStore from '../../data/store'; -import { bluehostSettingsApiFetch, bluehostPurgeCacheApiFetch } from '../../util/helpers'; -import { useUpdateEffect } from 'react-use'; -import { Fragment, useState } from '@wordpress/element'; -import { useNotification } from '../../components/notifications/feed'; -import { Alert, Button, Label, RadioGroup } from "@newfold/ui-component-library"; -import { SectionSettings } from "../../components/section"; - -const CacheSettings = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); - const [cacheLevel, setCacheLevel] = useState(store.cacheLevel); - - const cacheOptions = [ - { - label: __('Disabled', 'wp-plugin-bluehost'), - description: __('No cache enabled. Every page load is fresh.', 'wp-plugin-bluehost') + - ' ' + - __('Not recommended.', 'wp-plugin-bluehost'), - value: 0, - notice: __('Caching disabled.', 'wp-plugin-bluehost'), - }, - { - label: __('Assets Only', 'wp-plugin-bluehost'), - description: __('Cache static assets like images and the appearance of your site for 1 hour.', 'wp-plugin-bluehost') + - ' ' + - __('Tuned for online stores and member sites that need to be fresh.', 'wp-plugin-bluehost'), - value: 1, - notice: __('Cache enabled for assets only.', 'wp-plugin-bluehost'), - }, - { - label: __('Assets & Web Pages', 'wp-plugin-bluehost'), - description: __('Cache static assets for 24 hours and web pages for 2 hours.', 'wp-plugin-bluehost') + - ' ' + - __('Tuned for sites that change at least weekly.', 'wp-plugin-bluehost'), - value: 2, - notice: __('Cache enabled for assets and pages.', 'wp-plugin-bluehost'), - }, - { - label: __('Assets & Web Pages - Extended', 'wp-plugin-bluehost'), - description: __('Assets & Web Pages - Extended', 'wp-plugin-bluehost') + - ' ' + - __('Tuned for sites that update a few times a month or less.', 'wp-plugin-bluehost'), - value: 3, - notice: __('Cache enabled for assets and pages (extended).', 'wp-plugin-bluehost'), - }, - ]; - - const getCacheLevelNoticeTitle = () => { - return __('Cache setting saved', 'wp-plugin-bluehost'); - }; - - const getCacheLevelNoticeText = () => { - return cacheOptions[cacheLevel].notice; - }; - - const handleCacheLevelChange = (e) => { - bluehostSettingsApiFetch({ cacheLevel: parseInt(e.target.value) }, setError, (response) => { - setCacheLevel(parseInt(e.target.value)); - }); - }; - - const notifySuccess = () => { - notify.push("cache-level-change-notice", { - title: getCacheLevelNoticeTitle(), - description: ( - - {getCacheLevelNoticeText()} - - ), - variant: "success", - autoDismiss: 5000, - }); - }; - - useUpdateEffect(() => { - setStore({ - ...store, - cacheLevel, - }); - - notifySuccess(); - }, [cacheLevel]); - - return ( - - {cacheOptions.map((option) => { - return ( - - -
- {option.description} -
-
- ); - })} -
- ); -} - -const ClearCache = ({ setError, notify }) => { - const { store, setStore } = useContext(AppStore); - - const getCacheClearNoticeTitle = () => { - return __('Cache cleared', 'wp-plugin-bluehost'); - }; - - const notifySuccess = () => { - notify.push("disable-old-posts-comments-notice", { - title: getCacheClearNoticeTitle(), - variant: "success", - autoDismiss: 5000, - }); - }; - - const clearCache = () => { - bluehostPurgeCacheApiFetch({}, setError, (response) => { - notifySuccess(); - }); - }; - - return ( -
-
- - -
-

- { - __('We automatically clear your cache', 'wp-plugin-bluehost') + - ', ' + - __("as you work (creating content, changing settings, installing plugins and more). But you can manually clear it here to be confident it's fresh.", 'wp-plugin-bluehost') - } -

- -
- ); -} - -const Performance = () => { - const [isError, setError] = useState(false); - - let notify = useNotification(); - - return ( - -
- - -
- - - - {isError && - - {__('Oops! Something went wrong. Please try again.', 'wp-plugin-bluehost')} - - } -
-
-
- ); -} - -export default Performance; diff --git a/tests/cypress/fixtures/bluehost-logo.png b/tests/cypress/fixtures/bluehost-logo.png deleted file mode 100644 index 88f61446f..000000000 Binary files a/tests/cypress/fixtures/bluehost-logo.png and /dev/null differ diff --git a/tests/cypress/fixtures/customerData.json b/tests/cypress/fixtures/customerData.json deleted file mode 100644 index b7f904077..000000000 --- a/tests/cypress/fixtures/customerData.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "customer": { - "customer_id": "1234567890", - "signup_date": "2022-08-18T15:30:00.000Z" - }, - "plan": { - "subtype": "wc_standard" - } -} \ No newline at end of file diff --git a/tests/cypress/integration/home.cy.js b/tests/cypress/integration/home.cy.js index 9333e3911..9bd0e12e9 100644 --- a/tests/cypress/integration/home.cy.js +++ b/tests/cypress/integration/home.cy.js @@ -22,14 +22,14 @@ describe('Home Page', function () { it('Welcome Section Exists', () => { cy - .get('.wppb-app-section-container').contains('h2', 'Home') + .get('.nfd-app-section-container').contains('h2', 'Home') .scrollIntoView() .should('be.visible'); }); it('Additional Features Section Exists', () => { cy - .get('.wppb-app-section-container').contains('h2', 'Additional Features') + .get('.nfd-app-section-container').contains('h2', 'Additional Features') .scrollIntoView() .should('be.visible'); }); diff --git a/tests/cypress/integration/performance.cy.js b/tests/cypress/integration/performance.cy.js deleted file mode 100644 index 3514d5bde..000000000 --- a/tests/cypress/integration/performance.cy.js +++ /dev/null @@ -1,83 +0,0 @@ -// - -describe('Performance Page', function () { - - before(() => { - cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/performance'); - cy.injectAxe(); - - }); - - it('Is Accessible', () => { - cy.wait(500); - cy.checkA11y('.wppbh-app-body'); - }); - - it('Has Cache Settings', () => { - cy - .get('.cache-options') - .scrollIntoView() - .should('be.visible'); - }); - - it('Has Clear Cache Settings', () => { - cy - .get('.clear-cache') - .scrollIntoView() - .should('be.visible'); - }); - - // this is no longer connected - it.skip('Clear Cache Disabled when Cache is Disabled', () => { - - cy - .get('input[type="radio"]#cache-level-0').check(); - - cy.wait(500); - - cy - .get('.clear-cache-button') - .scrollIntoView() - .should('have.class', 'disabled'); - - cy.get('input[type="radio"]#cache-level-1').check(); - - cy - .get('.clear-cache-button') - .scrollIntoView() - .should('not.have.class', 'disabled'); - - cy - .get('.edit-site-notices .components-snackbar__content') - .contains('div', 'Cache') - .should('be.visible'); - }); - - // this is no longer in place - it.skip('Settings Callout Navigates to Settings Page', () => { - cy.hash().should('eq', '#/performance'); - cy.get('a.callout-link-settings').click(); - cy.wait(500); - cy.hash().should('eq', '#/settings'); - cy.get('a.callout-link-performance').click(); - cy.wait(500); - cy.hash().should('eq', '#/performance'); - cy - .get('.card-cache-settings') - .should('be.visible'); - }); - - // can't test clear cache without endurance page cache being installed - // how to do in cypress env? - // it('Clear Cache Button Functions', () => { - // cy - // .get('.card-clear-cache button') - // .click(); - - // cy - // .get('.edit-site-notices .components-snackbar__content') - // .contains('div', 'Cache cleared') - // .should('be.visible'); - // }); - -}); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/1-Initial-steps/branding.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/1-Initial-steps/branding.cy.js deleted file mode 100644 index dcb67dc0f..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/1-Initial-steps/branding.cy.js +++ /dev/null @@ -1,43 +0,0 @@ -// - -describe( 'Branding', function () { - before( () => { - cy.clearCustomerData(); - cy.visit( 'wp-admin/index.php?page=nfd-onboarding' ); - } ); - - // since we are setting brand from plugin container, it will not be set to "newfold" - // by default even if mm_brand option is deleted from the database - it( 'Has Bluehost CSS when mm_brand does not exist.', () => { - cy.exec( 'npx wp-env run cli wp option delete mm_brand' ); - cy.reload(); - cy.get( 'body' ).should( 'have.class', 'nfd-brand-bluehost' ); - cy.get( '.is-bg-primary' ) - .should( 'have.css', 'background-color', 'rgb(53, 117, 211)' ) - .should( 'have.css', 'color', 'rgb(255, 255, 255)' ); - cy.get( '.nfd-step-card-subheading' ).should( 'contain', 'Bluehost' ); - } ); - - it( 'Has default WordPress styles when mm_brand has an empty value', () => { - const emptyString = JSON.stringify( '' ); - cy.exec( - `npx wp-env run cli wp option set mm_brand '${ emptyString }'` - ); - cy.reload(); - cy.get( 'body' ).should( 'have.class', 'nfd-brand-wordpress' ); - cy.get( '.is-bg-primary' ) - .should( 'have.css', 'background-color', 'rgb(0, 124, 186)' ) - .should( 'have.css', 'color', 'rgb(255, 255, 255)' ); - cy.get( '.nfd-step-card-subheading' ).should( 'contain', 'web host' ); - } ); - - it( 'Has brand specific CSS for Bluehost', () => { - cy.exec( 'npx wp-env run cli wp option update mm_brand BlueHost' ); - cy.reload(); - cy.get( 'body' ).should( 'have.class', 'nfd-brand-bluehost' ); - cy.get( '.is-bg-primary' ) - .should( 'have.css', 'background-color', 'rgb(53, 117, 211)' ) - .should( 'have.css', 'color', 'rgb(255, 255, 255)' ); - cy.get( '.nfd-step-card-subheading' ).should( 'contain', 'Bluehost' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/1-Initial-steps/whats-next.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/1-Initial-steps/whats-next.cy.js deleted file mode 100644 index 3d762df4a..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/1-Initial-steps/whats-next.cy.js +++ /dev/null @@ -1,74 +0,0 @@ -// -import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'What Next Page', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/what-next' - ); - cy.wait( 5000 ); - } ); - - it.skip( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Exit to WordPress', - ':nth-child(6)', - 'What Next', - false - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__what-next', 'What’s Next' ); - CheckIllustrationPanel( '__what-next' ); - CheckInfoPanel( 2 ); - CheckHelpPanelLinks(); - } ); - - it( 'Check if whatnext card is visible', () => { - cy.get( '.whatnext-card' ).should( 'be.visible' ); - } ); - - it( 'Hovering over overview tab panel and asserting the tab data', () => { - cy.contains( 'button', 'WHATS NEXT' ).trigger( 'mouseover' ); - cy.get( '.tab-text' ).should( - 'contain', - 'Add content, organize your menu and launch.' - ); - cy.contains( 'button', 'HELP & RESOURCES' ).trigger( 'mouseover' ); - cy.get( '.tab-text' ).should( - 'contain', - "Next step or next level, we're your partner." - ); - cy.contains( 'button', 'HIRE OUR EXPERTS' ).trigger( 'mouseover' ); - cy.get( '.tab-text' ).should( - 'contain', - 'Make our great people your people.' - ); - } ); - - it( 'Check if main heading and sub heading shows up', () => { - CheckCardHeadingSubheading(); - } ); - - it( 'Check navigation back is not visible', () => { - cy.get( '.navigation-buttons_back' ).should( 'not.exist' ); - } ); - - it( 'Check if complete setup button is visible', () => { - cy.contains( 'button', 'Complete Setup' ).should( 'be.visible' ); - } ); - - it( 'Check Finish button is visible and finish the setup', () => { - cy.contains( 'button', 'Finish' ).should( 'be.visible' ).click(); - cy.wait( 1000 ); - cy.url().should( 'not.contain', '/wp-setup/step/what-next' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/basic-info.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/basic-info.cy.js deleted file mode 100644 index 1c65080c2..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/basic-info.cy.js +++ /dev/null @@ -1,167 +0,0 @@ -// -import { - DrawerActivityForMenu, - DrawerClose -} from '../wp-module-support/drawer.cy'; -import { CheckHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Basic Info Page', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding#/wp-setup/step/basic-info' - ); - } ); - - it.skip( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Exit to WordPress', - ':nth-child(3)', - 'Basic Info' - ); - } ); - - it( 'Check if Header and Subheader shows up', () => { - cy.wait(3000); - DrawerClose(); - CheckHeadingSubheading(); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__basic-info', 'Basic Info' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check if Header has text `website` in it', () => { - cy.get( '.nfd-main-heading__title' ) - .should('be.visible') - .contains('website'); - } ); - - it( 'Enter a Title and then Check if it reflects elsewhere', () => { - const title = 'Hello WordPress'; - const titleBox = cy.get( ':nth-child(1) > label > .nfd-input__field' ); - if ( titleBox.should( 'exist' ) ) { - titleBox.scrollIntoView(); - titleBox.clear(); - cy.wait( 1000 ); - titleBox.type( title ); - - // Check if Mini Preview Tab has the Title - cy.get( '.browser-row-title_bar_main-text' ).contains( title ); - // Check if Mini Preview Webpage Search result has the Title - cy.get( '.browser-content_top-row-name' ).contains( title ); - } - } ); - - it( 'Enter a Desc and then Check if it reflects elsewhere', () => { - const desc = 'Welcome to WordPress'; - const descBox = cy.get( ':nth-child(2) > label > .nfd-input__field' ); - if ( descBox.should( 'exist' ) ) { - descBox.scrollIntoView(); - descBox.clear(); - cy.wait( 1000 ); - descBox.type( desc ); - - // Check if Mini Preview Webpage Search result has the Desc - cy.get( '.browser-content_desc' ).contains( desc ); - } - } ); - - it( 'Check if Social Media Accordion Toggles', () => { - cy.get( - ':nth-child(7) > .social-form__label > .social-form__label_name' - ) - .should( 'exist' ) - .should( 'not.be.visible' ); - - // Open Social Media Accordion - cy.get( '.social-form__top-row_icon' ).click(); - cy.get( - ':nth-child(7) > .social-form__label > .social-form__label_name' - ) - .should( 'exist' ) - .scrollIntoView() - .should('have.css', 'opacity', '1'); - } ); - - it( 'Check if Social Media URL checks are done', () => { - const invalidURL = 'htt'; - const validURL = 'https://www.facebook.com'; - - // Facebook Social Media Component - const socialTest2 = cy.get( '#twitter' ); - const socialTest = cy.get( '#facebook' ); - - if ( socialTest.should( 'exist' ) ) { - socialTest.clear(); - cy.get( - '.browser-content_social_icon[style="background-image: var(--facebook-icon);"]' - ).should( 'have.css', 'opacity', '0.5' ); - - socialTest.focus(); - socialTest.type( invalidURL ); - socialTest2.focus(); - - // The URL Checker runs on a debounce - // Shows the message to the User in case of Invalid URL - cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should( 'exist' ); - cy.get( - '.browser-content_social_icon[style="background-image: var(--facebook-icon);"]' - ).should( 'have.css', 'opacity', '0.75' ); - - socialTest.focus(); - socialTest.clear(); - socialTest.type( validURL ); - socialTest2.focus(); - cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should( - 'not.exist' - ); - cy.get( - '.browser-content_social_icon[style="background-image: var(--facebook-icon);"]' - ).should( 'have.css', 'opacity', '1' ); - - // Close Social Media Accordion - cy.get( '.social-form__top-row_icon' ).click(); - } - } ); - - it( 'Check if Image gets Uploaded', () => { - const sampleLogo = 'tests/cypress/fixtures/bluehost-logo.png'; - - if ( - cy - .get( '.image-uploader_window-reset-btn' ) - .should( 'exist' ) - .contains( 'UPLOAD' ) - ) { - cy.get( '.image-uploader_window-logo-icon-selected' ).should( - 'not.exist' - ); - - // Upload the Image into the Upload Section - cy.get( '.image-uploader_window-select-btn', { timeout: 10000 } ) - .scrollIntoView() - .should( 'exist' ) - .selectFile( sampleLogo, { force: true } ) - .then( () => { - cy.wait( 1000 ); - // Check if the image got uploaded - cy.get( - '.image-uploader_window-logo-icon-selected' - ).should( 'exist' ); - cy.get( '.image-uploader_window-reset-btn' ) - .should( 'exist' ) - .scrollIntoView() - .contains( 'RESET' ); - } ); - } - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/exit-to-wordpress.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/exit-to-wordpress.cy.js deleted file mode 100644 index 5794073ec..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/exit-to-wordpress.cy.js +++ /dev/null @@ -1,40 +0,0 @@ -// - -describe( 'Exit to WordPress', function () { - before( () => { - cy.visit( 'wp-admin/?page=nfd-onboarding#/wp-setup/step/basic-info' ); - } ); - - it.skip( 'Go to the Page where the Drawer contains Exit to WordPress Button', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).click(); - cy.get( '.components-modal__content' ).should( 'be.visible' ); - } ); - - it.skip( 'Check if heading and paragraph content exists', () => { - cy.get( 'h1.components-modal__header-heading' ).should( 'be.visible' ); - cy.get( '.components-modal__content > p' ).should( 'be.visible' ); - } ); - - it.skip( "Stay on Onboarding Page when 'X'/Continue is clicked", () => { - cy.url().then( ( currUrl ) => { - // When 'X' is clicked - cy.get( '.components-modal__header > .components-button' ).click(); - cy.url().should( 'equal', currUrl ); - - // When 'Continue' is clicked - cy.get( '.nfd-onboarding-etw__trigger' ).click(); - cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); - cy.url().should( 'equal', currUrl ); - } ); - } ); - - it.skip( 'Exit to WordPress Page', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).click(); - cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); - cy.url( { timeout: 12000 } ).should( 'contain', 'index.php' ); - } ); - - after( () => { - cy.clearCustomerData(); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/get-started-experience.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/get-started-experience.cy.js deleted file mode 100644 index 81c29b028..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/get-started-experience.cy.js +++ /dev/null @@ -1,97 +0,0 @@ -// -import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Start Setup WP Experience Page', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding#/wp-setup/step/get-started/experience' - ); - } ); - - it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { - CheckDrawerDisabled(); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( - '__get-started-wp-experience', - 'WordPress Experience' - ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check if Headers Load', () => { - CheckCardHeadingSubheading( true ); - } ); - - it( 'Check if `site` appears in heading', () => { - cy.get('.nfd-step-card-heading') - .should('be.visible') - .contains('site'); - } ); - - it( 'Check if Radio Options load', () => { - cy.get( '.components-radio-control__option' ) - .should( 'exist' ) - .and( 'be.visible' ) - .and( 'have.length', 3 ); - } ); - - it( 'Check if Continue Setup Button is Disabled when none of the options are checked', () => { - cy.get( '.nfd-card-button' ).should( 'be.disabled' ); - cy.url().should( 'contain', 'get-started/experience' ); - } ); - - it( 'Checks if all the Radio Buttons are Enabled and Highlighted when clicked', () => { - let radioCount = 0; - const className = '.components-radio-control__option'; - const arr = cy.get( className ); - arr.each( () => { - cy.get( '[type="radio"]' ) - .eq( radioCount ) - .click( { force: true } ) - .should( 'not.be.disabled' ) - .should( 'be.checked' ); - radioCount += 1; - } ); - } ); - - it( 'Checks if Continue Setup Button is Enabled after the Radio Button is Checked.', () => { - cy.get( '[type=radio]:checked' ).should( - 'have.css', - 'background-color', - 'rgb(53, 117, 211)' - ); - cy.get( '.nfd-card-button' ).should( 'not.be.disabled' ).click(); - cy.url().should( 'not.contain', 'get-started/experience' ); - cy.go( 'back' ); - } ); - - it( 'Navigation Buttons Landing on expected pages', () => { - cy.get( '.navigation-buttons_next' ).click(); - cy.url().should( 'not.include', '/get-started/experience' ); - cy.go( 'back' ); - - cy.get( '.navigation-buttons_back' ).click(); - cy.url().should( 'not.include', '/get-started/experience' ); - cy.go( 'back' ); - } ); - - it( 'Check Need Help Tag and Hire Experts URL', () => { - cy.get( '.nfd-card-need-help-tag' ) - .scrollIntoView() - .should( 'be.visible' ); - cy.get( '.nfd-card-need-help-tag > a' ) - .should( 'exist' ) - .should( 'have.attr', 'href' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/get-started-welcome.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/get-started-welcome.cy.js deleted file mode 100644 index 619580f12..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/get-started-welcome.cy.js +++ /dev/null @@ -1,92 +0,0 @@ -// -import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Get Started Welcome Page', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding#/wp-setup/step/get-started/welcome' - ); - } ); - - it( 'Change tab and check', () => { - let tabCount = 0; - const className = '#tab-panel-0-tab'; - const arr = cy.get( '.components-tab-panel__tabs > button' ); - arr.each( () => { - cy.get( className.concat( tabCount + 1 ) ) - .trigger( 'mouseover' ) - .should( 'be.visible' ); - cy.get( className.concat( tabCount + 1 ).concat( '-view' ) ).should( - 'be.visible' - ); - tabCount += 1; - } ); - } ); - - it.skip( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - } ); - - it.skip( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.components-modal__header > button' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - } ); - - it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { - CheckDrawerDisabled(); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__get-started-welcome', 'Start Setup' ); - CheckIllustrationPanel(); - CheckInfoPanel( 2 ); - CheckHelpPanelLinks( true, 'Hire Our Full-Service Creative Team' ); - } ); - - it( 'Check if welcome card is visible', () => { - cy.get( '.welcome-card' ).should( 'be.visible' ); - } ); - - it( 'Check if main heading and sub heading shows up', () => { - CheckCardHeadingSubheading(); - } ); - - it( 'Check for brandname in sub heading', () => { - cy.get( '.nfd-step-card-subheading' ).should( 'contain', 'Bluehost' ); - } ); - - it( 'Check if `website` appears in heading', () => { - cy.get('.nfd-step-card-heading') - .should('be.visible') - .contains('website'); - } ); - - it( 'Check navigation back is not visible', () => { - cy.get( '.navigation-buttons_back' ).should( 'not.exist' ); - } ); - - it( 'Check if next step loads on clicking navigation next', () => { - cy.get( '.navigation-buttons_next' ).click(); - cy.url().should( 'not.include', '#/wp-setup/step/get-started/welcome' ); - cy.go( 'back' ); - } ); - - it.skip( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); - cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/site-features.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/site-features.cy.js deleted file mode 100644 index e565c7ce8..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/site-features.cy.js +++ /dev/null @@ -1,60 +0,0 @@ -// -import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; -import { CheckHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Site Features', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding#/wp-setup/step/site-features' - ); - cy.wait( 10000 ); - } ); - - it( 'Check if Header and Subheader shows up', () => { - CheckHeadingSubheading(); - } ); - - it( 'Check if Header has text `site` in it', () => { - cy.get( '.nfd-main-heading__title' ) - .should('be.visible') - .contains('site'); - } ); - - it.skip( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Exit to WordPress', - ':nth-child(5)', - 'Features', - false - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__site-features', 'Features' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check if Site Features list exists and select them', () => { - let previewCount = 0; - const className = '.checkbox-item '; - const arr = cy.get( className ); - - arr.each( () => { - cy.get( className ) - .eq( previewCount ) - .find( '.components-base-control' ) - .find( 'input' ) - .scrollIntoView() - .click(); - previewCount += 1; - } ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/sitetype-primary.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/sitetype-primary.cy.js deleted file mode 100644 index 4c5bbd7c4..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/sitetype-primary.cy.js +++ /dev/null @@ -1,109 +0,0 @@ -// -import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Get Started Site Type Primary', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding#/wp-setup/step/get-started/site-primary' - ); - cy.wait( 3000 ); - } ); - - it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { - CheckDrawerDisabled(); - } ); - - it( 'Check if Header and Subheader shows up', () => { - CheckCardHeadingSubheading( true ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__get-started-site-secondary', 'Site Type' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check different Categories exist and is selectable', () => { - let categoryCount = 0; - const className = '.nfd-card-pri-category'; - cy.get( className ).should( 'be.visible' ); - const arr = cy.get( className ); - arr.each( () => { - cy.get( className ) - .eq( categoryCount ) - .click() - .should( 'have.class', 'chosenPrimaryCategory' ); - categoryCount += 1; - } ); - } ); - - it( 'Check if input box exists and is editable', () => { - let categoryCount = 0; - const className = '.nfd-card-pri-category'; - cy.get( className ).should( 'be.visible' ); - cy.get( '.nfd-setup-primary-custom__tellus-input' ) - .scrollIntoView() - .should( 'be.visible' ) - .type( 'Not Business' ); - const arr = cy.get( className ); - arr.each( () => { - cy.get( className ) - .eq( categoryCount ) - .should( 'not.have.class', 'chosenPrimaryCategory' ); - categoryCount += 1; - } ); - } ); - - it( 'Check selecting Category resets input box', () => { - cy.get( '.nfd-card-pri-category-wrapper span' ).first().click(); - cy.get( '.nfd-setup-primary-custom__tellus-input' ) - .scrollIntoView() - .should( 'be.visible' ) - .should( 'be.empty' ); - } ); - - it( 'Check existence of Need Help Tag', () => { - cy.get( '.nfd-card-need-help-tag' ) - .scrollIntoView() - .should( 'be.visible' ); - } ); - - it( 'Check existence of Need Help URL', () => { - cy.get( '.nfd-card-need-help-tag > a' ).should( 'have.attr', 'href' ); - } ); - - it( 'Go to the next step on clicking navigation Next', () => { - cy.get( '.navigation-buttons_next' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/get-started/site-primary' - ); - cy.go( 'back' ); - } ); - - it( 'Go to the previous step on clicking navigation Back', () => { - cy.get( '.navigation-buttons_back' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/get-started/site-primary' - ); - cy.go( 'back' ); - } ); - - it( 'Go to next step on Continue Setup', () => { - cy.get( '.nfd-nav-card-button' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/get-started/site-primary' - ); - cy.go( 'back' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/sitetype-secondary.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/sitetype-secondary.cy.js deleted file mode 100644 index b40d332d4..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/sitetype-secondary.cy.js +++ /dev/null @@ -1,126 +0,0 @@ -// -import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Get Started Site Type Secondary', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding#/wp-setup/step/get-started/site-secondary' - ); - cy.wait( 3000 ); - } ); - - it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { - CheckDrawerDisabled(); - } ); - - it( 'Check if Header and Subheader shows up', () => { - CheckCardHeadingSubheading( true ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__get-started-site-secondary', 'Site Type' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check different categories exist using `<` and `>`', () => { - cy.get( '.nfd-setup-secondary-categories' ).should( 'be.visible' ); - const category_selected = cy.get('.category-scrolling-wrapper__type-text'); - cy.get( '.category-scrolling-wrapper__left-btn' ) - .should('be.visible') - .click(); - cy.get( '.category-scrolling-wrapper__type-text' ).should('not.contain', category_selected); - cy.reload(); - cy.get('.category-scrolling-wrapper__right-btn-icon') - .should('be.visible') - .click(); - cy.get( '.category-scrolling-wrapper__type-text' ).should('not.contain', category_selected); - }); - - it( 'Check different subCategories exist and is selectable', () => { - let categoryCount = 0; - const className = '.subCategoriesSection'; - cy.get( className ).should( 'be.visible' ); - const arr = cy.get( className.concat( ' div' ) ); - arr.each( () => { - cy.get( className.concat( ' div' ) ) - .eq( categoryCount ) - .click() - .should( 'have.class', 'chosenSecondaryCategory' ); - categoryCount += 1; - } ); - } ); - - it( 'Check if input box exists and is editable', () => { - let categoryCount = 0; - const className = '.subCategoriesSection'; - cy.get( className ).should( 'be.visible' ); - cy.get( '.nfd-setup-primary-custom__tellus-input' ) - .scrollIntoView() - .should( 'be.visible' ) - .type( 'Cars' ); - const arr = cy.get( className.concat( ' div' ) ); - arr.each( () => { - cy.get( className.concat( ' div' ) ) - .eq( categoryCount ) - .should( 'not.have.class', 'chosenSecondaryCategory' ); - categoryCount += 1; - } ); - } ); - - it( 'Check selecting subCategory resets input box', () => { - cy.get( '.subCategoriesSection span' ).first().click(); - cy.get( '.subCategoriesSection' ) - .children() - .should( 'have.class', 'chosenSecondaryCategory' ); - cy.get( '.nfd-setup-primary-custom__tellus-input' ) - .scrollIntoView() - .should( 'be.visible' ) - .should( 'be.empty' ); - } ); - - it( 'Check existence of Need Help Tag', () => { - cy.get( '.nfd-card-need-help-tag' ) - .scrollIntoView() - .should( 'be.visible' ); - } ); - - it( 'Check existence of Need Help URL', () => { - cy.get( '.nfd-card-need-help-tag > a' ).should( 'have.attr', 'href' ); - } ); - - it( 'Go to the next step on clicking navigation Next', () => { - cy.get( '.navigation-buttons_next' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/get-started/site-secondary' - ); - cy.go( 'back' ); - } ); - - it( 'Go to the previous step on clicking navigation Back', () => { - cy.get( '.navigation-buttons_back' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/get-started/site-secondary' - ); - cy.go( 'back' ); - } ); - - it( 'Go to next step on Continue Setup', () => { - cy.get( '.nfd-nav-card-button' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/get-started/site-secondary' - ); - cy.go( 'back' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/top-priority.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/top-priority.cy.js deleted file mode 100644 index 76a887a7e..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/2-general-onboarding-flow/top-priority.cy.js +++ /dev/null @@ -1,77 +0,0 @@ -// -import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; -import { CheckHeadingSubheading } from '../wp-module-support/header.cy'; - -describe( 'Top Priority Page', function () { - before( () => { - cy.visit( 'wp-admin/?page=nfd-onboarding#/wp-setup/step/top-priority' ); - } ); - - it.skip( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Exit to WordPress', - ':nth-child(2)', - 'Top Priority' - ); - } ); - - it( 'Check if Header and Subheader shows up', () => { - CheckHeadingSubheading(); - } ); - - it( 'Check if different cards are present', () => { - cy.get( '.selectable_cards' ).should( 'be.visible' ); - } ); - - it( 'Check existence of Skip this Step button', () => { - cy.get( '.components-button.skip-button' ).should( 'be.visible' ); - } ); - - it( 'Click on different cards and move on to next page', () => { - let previewCount = 0; - const className = '.components-surface.components-card.nfd-card'; - const arr = cy.get( className ); - arr.each( () => { - cy.get( className ) - .eq( previewCount ) - .should( 'be.visible' ) - .click(); - previewCount += 1; - cy.get( '.nfd-card__body.nfd-selected-card' ) - .find( '.nfd-card__body_title' ) - .invoke( 'text' ) - .then( ( $ele ) => { - if ( $ele !== 'Selling' ) { - cy.get( - '.components-button.navigation-buttons.navigation-buttons_next.is-primary' - ).click(); - cy.url().should( 'include', 'step/basic-info', { - timeout: 30000, - } ); - cy.wait(5000); - cy.go( 'back' ); - cy.get( - '.nfd-card__body.nfd-selected-card> .nfd-card__body_title' - ).contains( $ele ); - } - } ); - } ); - cy.get( className ) - .eq( 1 ) - .then( ( $el ) => { - cy.get( className ).eq( 1 ).should( 'be.visible' ).click(); - cy.get( '.nfd-card__body.nfd-selected-card' ) - .find( '.nfd-card__body_title' ) - .invoke( 'text' ) - .then( ( $ele ) => { - cy.get( - '.components-button.navigation-buttons.navigation-buttons_next.is-primary' - ).click(); - cy.wait( 10000 ); - cy.url().should( 'include', 'step/address', { - timeout: 60000, - } ); - } ); - } ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/address.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/address.cy.js deleted file mode 100644 index 1644cfc3d..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/address.cy.js +++ /dev/null @@ -1,120 +0,0 @@ -// -import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Step Ecommerce Address/Store Details', function () { - before( () => { - cy.wait( 10000 ); - cy.exec('npx wp-env run cli wp option delete nfd_module_onboarding_flow'); - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/ecommerce/step/address' - ); - cy.wait( 8000 ); - } ); - - it( 'Check Drawer Activity', () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/ecommerce/step/address' - ); - cy.wait( 8000 ); - DrawerActivityForMenu( - 'Onboarding Menu', - ':nth-child(1)', - 'Street Address' - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__ecommerce-address', 'Street Address' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Checks if Heading and Subheading are present', () => { - CheckCardHeadingSubheading(); - } ); - - it( 'Checks if all the inputs are enabled', () => { - cy.get( 'select[name="country"]' ) - .should( 'be.visible' ) - .and( 'not.be.disabled' ) - .select( 'US' ); - cy.get( 'input[name="woocommerce_store_address"]' ) - .should( 'be.visible' ) - .and( 'not.be.disabled' ) - .clear() - .type( '5335 Gate Pkwy' ); - cy.get( 'input[name="woocommerce_store_city"]' ) - .should( 'be.visible' ) - .and( 'not.be.disabled' ) - .clear() - .type( 'Jacksonville' ); - cy.get( 'select[name="state"]' ) - .should( 'be.visible' ) - .and( 'not.be.disabled' ) - .select( 'FL' ); - cy.get( 'input[name="woocommerce_store_postcode"]' ) - .should( 'be.visible' ) - .and( 'not.be.disabled' ) - .clear() - .type( '32256' ); - cy.get( 'input[name="woocommerce_email_from_address"]' ) - .should( 'be.visible' ) - .and( 'not.be.disabled' ) - .clear() - .type( 'test123@gmail.com' ); - cy.get( 'select[name="woocommerce_currency"]' ) - .should( 'be.visible' ) - .and( 'not.be.disabled' ) - .select( 'USD' ); - } ); - - it( 'Checks if there are the correct number of countries', () => { - cy.get( 'select[name="country"]' ) - .find( 'option' ) - .should( 'have.length', 224 ); - } ); - - it( 'Populates the correct number of states for a country', () => { - cy.get( 'select[name="country"]' ).select( 'US' ); - cy.get( 'select[name="state"]' ) - .find( 'option' ) - .should( 'have.length', 55 ); - } ); - - it( 'Checks if there are the correct number of currencies', () => { - cy.get( 'select[name="woocommerce_currency"]' ) - .find( 'option' ) - .should( 'have.length', 163 ); - } ); - - it( 'Checks existence of Need Help Tag', () => { - cy.get( '.nfd-card-need-help-tag' ) - .scrollIntoView() - .should( 'be.visible' ); - } ); - - it( 'Checks existence of Need Help URL', () => { - cy.get( '.nfd-card-need-help-tag > a' ).should( 'have.attr', 'href' ); - } ); - - it( 'Checks if Continue Setup exists and is enabled', () => { - cy.get( '.nfd-nav-card-button' ) - .scrollIntoView() - .should( 'be.visible' ) - .and( 'not.be.disabled' ); - } ); - - it( 'Goes to next step on Continue Setup', () => { - cy.get( '.nfd-nav-card-button' ).scrollIntoView().click(); - cy.url().should( 'not.include', '#/ecommerce/step/address' ); - cy.go( 'back' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/basic-info.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/basic-info.cy.js deleted file mode 100644 index 2f668c40d..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/basic-info.cy.js +++ /dev/null @@ -1,162 +0,0 @@ -// -import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; -import { CheckHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Basic Info Page', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/basic-info' - ); - } ); - - it.skip( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Exit to WordPress', - ':nth-child(3)', - 'Basic Info' - ); - } ); - - it( 'Check if Header and Subheader shows up', () => { - CheckHeadingSubheading(); - } ); - - it( 'Check if `store` appears in heading', () => { - cy.get('.nfd-main-heading__title') - .should('be.visible') - .contains('store'); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__basic-info', 'Basic Info' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Enter a Title and then Check if it reflects elsewhere', () => { - const title = 'Hello WordPress'; - const titleBox = cy.get( ':nth-child(1) > label > .nfd-input__field' ); - if ( titleBox.should( 'exist' ) ) { - titleBox.scrollIntoView(); - titleBox.clear({force: true}); - cy.wait( 1000 ); - titleBox.type( title ); - - // Check if Mini Preview Tab has the Title - cy.get( '.browser-row-title_bar_main-text' ).contains( title ); - // Check if Mini Preview Webpage Search result has the Title - cy.get( '.browser-content_top-row-name' ).contains( title ); - } - } ); - - it( 'Enter a Desc and then Check if it reflects elsewhere', () => { - const desc = 'Welcome to WordPress'; - const descBox = cy.get( ':nth-child(2) > label > .nfd-input__field' ); - if ( descBox.should( 'exist' ) ) { - descBox.scrollIntoView(); - descBox.clear({force: true}); - cy.wait( 1000 ); - descBox.type( desc ); - - // Check if Mini Preview Webpage Search result has the Desc - cy.get( '.browser-content_desc' ).contains( desc ); - } - } ); - - it( 'Check if Social Media Accordion Toggles', () => { - cy.get( - ':nth-child(7) > .social-form__label > .social-form__label_name' - ) - .should( 'exist' ) - .should( 'not.be.visible' ); - - // Open Social Media Accordion - cy.get( '.social-form__top-row_icon' ).invoke('click'); - cy.get( - ':nth-child(7) > .social-form__label > .social-form__label_name' - ) - .should( 'exist' ) - .scrollIntoView() - .should('have.css', 'opacity', '1'); - } ); - - it( 'Check if Social Media URL checks are done', () => { - const invalidURL = 'htt'; - const validURL = 'https://www.facebook.com'; - - // Facebook Social Media Component - const socialTest2 = cy.get( '#twitter' ); - const socialTest = cy.get( '#facebook' ); - - if ( socialTest.should( 'exist' ) ) { - socialTest.clear({force: true}); - cy.get( - '.browser-content_social_icon[style="background-image: var(--facebook-icon);"]' - ).should( 'have.css', 'opacity', '0.5' ); - - socialTest2.focus(); - socialTest.type( invalidURL ); - socialTest2.focus(); - - // The URL Checker runs on a debounce - // Shows the message to the User in case of Invalid URL - cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should( 'exist' ); - cy.get( - '.browser-content_social_icon[style="background-image: var(--facebook-icon);"]' - ).should( 'have.css', 'opacity', '0.75' ); - - socialTest.focus(); - socialTest.clear(); - socialTest.type( validURL ); - socialTest2.focus(); - cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should( - 'not.exist' - ); - cy.get( - '.browser-content_social_icon[style="background-image: var(--facebook-icon);"]' - ).should( 'have.css', 'opacity', '1' ); - - // Close Social Media Accordion - cy.get( '.social-form__top-row_icon' ).click(); - } - } ); - - it( 'Check if Image gets Uploaded', () => { - const sampleLogo = 'tests/cypress/fixtures/bluehost-logo.png'; - - if ( - cy - .get( '.image-uploader_window-reset-btn' ) - .should( 'exist' ) - .contains( 'UPLOAD' ) - ) { - cy.get( '.image-uploader_window-logo-icon-selected' ).should( - 'not.exist' - ); - - // Upload the Image into the Upload Section - cy.get( '.image-uploader_window-select-btn', { timeout: 10000 } ) - .scrollIntoView() - .should( 'exist' ) - .selectFile( sampleLogo, { force: true } ) - .then( () => { - cy.wait( 1000 ); - // Check if the image got uploaded - cy.get( - '.image-uploader_window-logo-icon-selected' - ).should( 'exist' ); - cy.get( '.image-uploader_window-reset-btn' ) - .should( 'exist' ) - .scrollIntoView() - .contains( 'RESET' ); - } ); - } - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/exit-to-wordpress.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/exit-to-wordpress.cy.js deleted file mode 100644 index ae34916e0..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/exit-to-wordpress.cy.js +++ /dev/null @@ -1,40 +0,0 @@ -// - -describe( 'Exit to WordPress', function () { - before( () => { - cy.visit( 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/basic-info' ); - } ); - - it.skip( 'Go to the Page where the Drawer contains Exit to WordPress Button', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).click(); - cy.get( '.components-modal__content' ).should( 'be.visible' ); - } ); - - it.skip( 'Check if heading and paragraph content exists', () => { - cy.get( 'h1.components-modal__header-heading' ).should( 'be.visible' ); - cy.get( '.components-modal__content > p' ).should( 'be.visible' ); - } ); - - it.skip( "Stay on Onboarding Page when 'X'/Continue is clicked", () => { - cy.url().then( ( currUrl ) => { - // When 'X' is clicked - cy.get( '.components-modal__header > .components-button' ).click(); - cy.url().should( 'equal', currUrl ); - - // When 'Continue' is clicked - cy.get( '.nfd-onboarding-etw__trigger' ).click(); - cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); - cy.url().should( 'equal', currUrl ); - } ); - } ); - - it.skip( 'Exit to WordPress Page', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).click(); - cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); - cy.url( { timeout: 12000 } ).should( 'contain', 'bluehost' ); - } ); - - after( () => { - cy.clearCustomerData(); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/get-started-experience.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/get-started-experience.cy.js deleted file mode 100644 index 87a23c40c..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/get-started-experience.cy.js +++ /dev/null @@ -1,97 +0,0 @@ -// -import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Start Setup WP Experience Page', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/get-started/experience' - ); - } ); - - it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { - CheckDrawerDisabled(); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( - '__get-started-wp-experience', - 'WordPress Experience' - ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check if Headers Load', () => { - CheckCardHeadingSubheading( true ); - } ); - - it( 'Check if `store` appears in heading', () => { - cy.get('.nfd-step-card-heading') - .should('be.visible') - .contains('store'); - } ); - - it( 'Check if Radio Options load', () => { - cy.get( '.components-radio-control__option' ) - .should( 'exist' ) - .and( 'be.visible' ) - .and( 'have.length', 3 ); - } ); - - it( 'Check if Continue Setup Button is Disabled when none of the options are checked', () => { - cy.get( '.nfd-card-button' ).should( 'be.disabled' ); - cy.url().should( 'contain', 'get-started/experience' ); - } ); - - it( 'Checks if all the Radio Buttons are Enabled and Highlighted when clicked', () => { - let radioCount = 0; - const className = '.components-radio-control__option'; - const arr = cy.get( className ); - arr.each( () => { - cy.get( '[type="radio"]' ) - .eq( radioCount ) - .click( { force: true } ) - .should( 'not.be.disabled' ) - .should( 'be.checked' ); - radioCount += 1; - } ); - } ); - - it( 'Checks if Continue Setup Button is Enabled after the Radio Button is Checked.', () => { - cy.get( '[type=radio]:checked' ).should( - 'have.css', - 'background-color', - 'rgb(53, 117, 211)' - ); - cy.get( '.nfd-card-button' ).should( 'not.be.disabled' ).click(); - cy.url().should( 'not.contain', 'get-started/experience' ); - cy.go( 'back' ); - } ); - - it( 'Navigation Buttons Landing on expected pages', () => { - cy.get( '.navigation-buttons_next' ).click(); - cy.url().should( 'not.include', '/get-started/experience' ); - cy.go( 'back' ); - - cy.get( '.navigation-buttons_back' ).click(); - cy.url().should( 'not.include', '/get-started/experience' ); - cy.go( 'back' ); - } ); - - it( 'Check Need Help Tag and Hire Experts URL', () => { - cy.get( '.nfd-card-need-help-tag' ) - .scrollIntoView() - .should( 'be.visible' ); - cy.get( '.nfd-card-need-help-tag > a' ) - .should( 'exist' ) - .should( 'have.attr', 'href' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/get-started-welcome.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/get-started-welcome.cy.js deleted file mode 100644 index 882df93d4..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/get-started-welcome.cy.js +++ /dev/null @@ -1,94 +0,0 @@ -// -import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Get Started Welcome Page', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/get-started/welcome' - ); - } ); - - it( 'Change tab and check', () => { - let tabCount = 0; - const className = '#tab-panel-0-tab'; - const arr = cy.get( '.components-tab-panel__tabs > button' ); - arr.each( () => { - cy.get( className.concat( tabCount + 1 ) ) - .trigger( 'mouseover' ) - .should( 'be.visible' ); - cy.get( className.concat( tabCount + 1 ).concat( '-view' ) ).should( - 'be.visible' - ); - tabCount += 1; - } ); - } ); - - it.skip( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - } ); - - it.skip( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.components-modal__header > button' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - } ); - - it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { - CheckDrawerDisabled(); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__get-started-welcome', 'Start Setup' ); - CheckIllustrationPanel(); - CheckInfoPanel( 2 ); - CheckHelpPanelLinks( true, 'Hire Our Full-Service Creative Team' ); - } ); - - it( 'Check if welcome card is visible', () => { - cy.get( '.welcome-card' ).should( 'be.visible' ); - } ); - - it( 'Check if main heading and sub heading shows up', () => { - CheckCardHeadingSubheading(); - } ); - - it( 'Check for brandname in sub heading', () => { - cy.exec( 'npx wp-env run cli wp option set mm_brand BlueHost' ); - cy.reload(); - cy.get( '.nfd-step-card-subheading' ).should( 'contain', 'Bluehost' ); - } ); - - it( 'Check if `store` appears in heading', () => { - cy.get('.nfd-step-card-heading') - .should('be.visible') - .contains('store'); - } ); - - it( 'Check navigation back is not visible', () => { - cy.get( '.navigation-buttons_back' ).should( 'not.exist' ); - } ); - - it( 'Check if next step loads on clicking navigation next', () => { - cy.get( '.navigation-buttons_next' ).click(); - cy.url().should( 'not.include', '#/wp-setup/step/get-started/welcome' ); - cy.go( 'back' ); - } ); - - it.skip( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); - cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/products.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/products.cy.js deleted file mode 100644 index 08b2f3c3e..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/products.cy.js +++ /dev/null @@ -1,105 +0,0 @@ -// -import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Step Ecommerce Products Info', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/ecommerce/step/products' - ); - cy.wait( 5000 ); - } ); - - it( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Onboarding Menu', - ':nth-child(2)', - 'Product Info', - false - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__ecommerce-products', 'Products Info' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Checks if Heading and Subheading are present', () => { - CheckCardHeadingSubheading(); - } ); - - it( 'Checks if there are the correct number of product checkboxes.', () => { - cy.get( '.nfd-product-step-options' ) - .find( '.components-checkbox-control' ) - .should( 'have.length', 8 ); - } ); - - it( 'Checks if there are the correct number of product count radio controls.', () => { - cy.get( '.step-product-numbers' ) - .find( '.components-radio-control__option' ) - .should( 'have.length', 5 ); - } ); - - it( 'Checks if all the product checkboxes are enabled.', () => { - cy.get( '.nfd-product-step-options' ) - .find( '.components-checkbox-control' ) - .each( ( $checkBox ) => { - expect( $checkBox ).not.be.disabled; - } ); - } ); - - it( 'Checks if all the product count radio controls are enabled and checked.', () => { - let radioCount = 0; - const className = '.components-radio-control__option'; - const arr = cy.get( className ); - arr.each( () => { - cy.get( '[type="radio"]' ) - .eq( radioCount ) - .click( { force: true } ) - .should( 'not.be.disabled' ) - .should( 'be.checked' ); - radioCount += 1; - } ); - } ); - - it( 'Checks if all the product checkboxes can be checked.', () => { - let checkboxCount = 0; - const className = '.components-checkbox-control__input-container'; - const arr = cy.get( className ); - arr.each( () => { - cy.get( className ).eq( checkboxCount ).click(); - cy.get( '[type=checkbox]' ) - .eq( checkboxCount ) - .should( 'be.checked' ); - cy.get( className ).eq( checkboxCount ).click(); - cy.get( '[type=checkbox]' ) - .eq( checkboxCount ) - .should( 'not.be.checked' ); - checkboxCount += 1; - } ); - } ); - - it( 'Checks existence of Need Help Tag.', () => { - cy.get( '.nfd-card-need-help-tag' ) - .scrollIntoView() - .should( 'be.visible' ); - } ); - - it( 'Checks existence of Need Help URL.', () => { - cy.get( '.nfd-card-need-help-tag > a' ).should( 'have.attr', 'href' ); - } ); - - it( 'Goes to next step on Continue Setup.', () => { - cy.get( '.nfd-nav-card-button' ).click(); - cy.url().should( 'not.include', '#/ecommerce/step/products' ); - cy.go( 'back' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/site-features.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/site-features.cy.js deleted file mode 100644 index 38a265f6e..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/site-features.cy.js +++ /dev/null @@ -1,54 +0,0 @@ -// -import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; -import { CheckHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Site Features', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/site-features' - ); - cy.wait( 10000 ); - } ); - - it( 'Check if Header and Subheader shows up', () => { - CheckHeadingSubheading(); - } ); - - it.skip( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Exit to WordPress', - ':nth-child(5)', - 'Features', - false - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__site-features', 'Features' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check if Site Features list exists and select them', () => { - let previewCount = 0; - const className = '.checkbox-item '; - const arr = cy.get( className ); - - arr.each( () => { - cy.get( className ) - .eq( previewCount ) - .find( '.components-base-control' ) - .find( 'input' ) - .scrollIntoView() - .click(); - previewCount += 1; - } ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js deleted file mode 100644 index 58a32b2d4..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js +++ /dev/null @@ -1,126 +0,0 @@ -// -import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Get Started Site Type Secondary', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/get-started/site-secondary' - ); - cy.wait( 3000 ); - } ); - - it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { - CheckDrawerDisabled(); - } ); - - it( 'Check if Header and Subheader shows up', () => { - CheckCardHeadingSubheading( true ); - } ); - - it( 'Check if `store` appears in heading', () => { - cy.get('.nfd-step-card-heading') - .should('be.visible') - .contains('store'); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__get-started-site-secondary', 'Store Type' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check selected category is visible and selected', () => { - cy.get( '.category-scrolling-wrapper' ).should( 'be.visible' ); - cy.get( '.category-scrolling-wrapper__type-text' ).should( - 'contain', - 'Business' - ); - } ); - - it( 'Check different subCategories exist and is selectable', () => { - let categoryCount = 0; - const className = '.subCategoriesSection'; - cy.get( className ).should( 'be.visible' ); - const arr = cy.get( className.concat( ' div' ) ); - arr.each( () => { - cy.get( className.concat( ' div' ) ) - .eq( categoryCount ) - .click() - .should( 'have.class', 'chosenSecondaryCategory' ); - categoryCount += 1; - } ); - } ); - - it( 'Check if input box exists and is editable', () => { - let categoryCount = 0; - const className = '.subCategoriesSection'; - cy.get( className ).should( 'be.visible' ); - cy.get( '.nfd-setup-primary-custom__tellus-input' ) - .scrollIntoView() - .should( 'be.visible' ) - .type( 'Cars' ); - const arr = cy.get( className.concat( ' div' ) ); - arr.each( () => { - cy.get( className.concat( ' div' ) ) - .eq( categoryCount ) - .should( 'not.have.class', 'chosenSecondaryCategory' ); - categoryCount += 1; - } ); - } ); - - it( 'Check selecting subCategory resets input box', () => { - cy.get( '.subCategoriesSection span' ).first().click(); - cy.get( '.subCategoriesSection' ) - .children() - .should( 'have.class', 'chosenSecondaryCategory' ); - cy.get( '.nfd-setup-primary-custom__tellus-input' ) - .scrollIntoView() - .should( 'be.visible' ) - .should( 'be.empty' ); - } ); - - it( 'Check existence of Need Help Tag', () => { - cy.get( '.nfd-card-need-help-tag' ) - .scrollIntoView() - .should( 'be.visible' ); - } ); - - it( 'Check existence of Need Help URL', () => { - cy.get( '.nfd-card-need-help-tag > a' ).should( 'have.attr', 'href' ); - } ); - - it( 'Go to the next step on clicking navigation Next', () => { - cy.get( '.navigation-buttons_next' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/get-started/site-secondary' - ); - cy.go( 'back' ); - } ); - - it( 'Go to the previous step on clicking navigation Back', () => { - cy.get( '.navigation-buttons_back' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/get-started/site-secondary' - ); - cy.go( 'back' ); - } ); - - it( 'Go to next step on Continue Setup', () => { - cy.get( '.nfd-nav-card-button' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/get-started/site-secondary' - ); - cy.go( 'back' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/tax-info.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/tax-info.cy.js deleted file mode 100644 index 2973e4040..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/3-ecommerce-onboarding-flow/tax-info.cy.js +++ /dev/null @@ -1,74 +0,0 @@ -// -import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; -import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../wp-module-support/sidebar.cy'; - -describe( 'Step Ecommerce Tax Information', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/ecommerce/step/tax' - ); - cy.wait( 5000 ); - } ); - - it.skip( 'Check Drawer Activity', () => { - DrawerActivityForMenu( 'Onboarding Menu', ':nth-child(2)', 'Tax Info', false ); - } ); - - it.skip( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__ecommerce-tax-info', 'Tax Info' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it.skip( 'Checks if Heading and Subheading are present.', () => { - CheckCardHeadingSubheading(); - } ); - - it.skip( 'Checks if Continue Setup is disabled.', () => { - cy.get( '.nfd-nav-card-button' ).should( 'be.disabled' ); - } ); - - it.skip( 'Checks if there are the correct number of tax preference radio controls.', () => { - cy.get( '.components-radio-control__option' ).should( - 'have.length', - 3 - ); - } ); - - it.skip( 'Checks if all the tax preference radio control buttons are enabled and clickable.', () => { - let radioCount = 0; - const className = '[type="radio"]'; - const arr = cy.get( className ); - arr.each( () => { - cy.get( className ) - .eq( radioCount ) - .click( { force: true } ) - .should( 'not.be.disabled' ) - .should( 'be.checked' ); - radioCount += 1; - } ); - } ); - - it.skip( 'Checks existence of Need Help Tag.', () => { - cy.get( '.nfd-card-need-help-tag' ) - .scrollIntoView() - .should( 'be.visible' ); - } ); - - it.skip( 'Checks existence of Need Help URL.', () => { - cy.get( '.nfd-card-need-help-tag > a' ).should( 'have.attr', 'href' ); - } ); - - it.skip( 'Goes to the next step on clicking navigation Next.', () => { - cy.get( '.navigation-buttons_next' ).click(); - cy.url().should( 'not.include', '#/ecommerce/step/tax' ); - cy.go( 'back' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/colors-step.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/colors-step.cy.js deleted file mode 100644 index 4655a7b90..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/colors-step.cy.js +++ /dev/null @@ -1,87 +0,0 @@ -// -import { DrawerActivityForSubMenu } from '../../wp-module-support/drawer.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../../wp-module-support/sidebar.cy'; - -describe( 'Colors Step Test', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/design/theme-styles/preview' - ); - } ); - - it( 'Navigate to Colors Step', () => { - cy.wait( 10000 ); - // Have to select the Preview Step Checkbox to activate Colors and Typgoraphy - cy.get( '.theme-styles-preview__checkbox__label' ).click(); - cy.get( '.navigation-buttons_next' ).click(); - cy.wait( 10000 ); - } ); - - it( 'Check Drawer Activity', () => { - DrawerActivityForSubMenu( - 'Design', - '.theme-colors--drawer', - '.color-palette', - 11 - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__design-colors', 'Colors' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check if Default Color variations exists and are selectable', () => { - let previewCount = 0; - const className = '.color-palette '; - const arr = cy.get( className ); - - arr.each( () => { - cy.get( className ).eq( previewCount ).click(); - cy.get( '.color-palette-selected' ) - .scrollIntoView() - .should( 'be.visible' ); - previewCount += 1; - } ); - } ); - - it( 'Check for Custom Colors', () => { - // Opens Custom Palette - cy.get( '.custom-palette__top' ).scrollIntoView().click(); - - let previewCount = 0; - const className = '.custom-palette__below-row'; - const arr = cy.get( className ); - - // Select Colors for custom Palette - const colors = [ - 'F312345', - 'DA34125', - '2512453', - '85E01D2', - 'C541A04', - ]; - - arr.each( () => { - // Get a Random Color to be used - const randomIndex = Math.floor( Math.random() * colors.length ); - cy.get( className ).eq( previewCount ).click(); - cy.get( '.components-input-control__input' ).clear(); - cy.get( '.components-input-control__input' ).type( - colors[ randomIndex ] - ); - cy.get( className ).eq( previewCount ).click(); - previewCount += 1; - } ); - - // Closes Custom Palette - cy.get( '.custom-palette__top' ).scrollIntoView().click(); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/continue-onboarding.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/continue-onboarding.cy.js deleted file mode 100644 index a2acf33e3..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/continue-onboarding.cy.js +++ /dev/null @@ -1,65 +0,0 @@ -describe( 'Theme change from wp dashboard and continue onboarding flow', function () { - before( () => { - cy.exec( 'npx wp-env run cli wp theme activate twentytwentyone' ); - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/design/theme-styles/menu' - ); - } ); - - it( 'Click on exit to wordpress and go on to homepage', () => { - cy.get( '.components-modal__content', { timeout: 40000 } ).should( - 'be.visible' - ); - cy.contains( 'button', 'Exit to WordPress' ).click(); - cy.url( { timeout: 12000 } ).should( 'contain', '#/home' ); - } ); - - it( 'Change the theme from dashboard and then click on continue to continue', () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/design/theme-styles/menu' - ); - cy.get( '.components-modal__content', { timeout: 40000 } ).should( - 'be.visible' - ); - cy.contains( 'button', 'Continue' ).click(); - } ); - - it( 'Check the Heading title of theme style', () => { - cy.get( '.nfd-main-heading__title', { timeout: 5000 } ).should( - 'contain', - 'Lets tailor your theme for the perfect fit' - ); - } ); - - it( 'Change the theme from dashboard and then click on X to continue', () => { - cy.exec( 'npx wp-env run cli wp theme activate twentytwentyone' ); - cy.get( '.nfd-onboarding-drawer__panel-menu-link' ).eq( 2 ).click(); // to click on Home Page Menu Layout - cy.get( '.components-modal__content', { timeout: 40000 } ).should( - 'be.visible' - ); - cy.get( '.components-modal__header > .components-button' ).click(); - } ); - - it( 'Check the Heading title of HomePage Menu', () => { - cy.get( '.nfd-main-heading__title', { timeout: 5000 } ).should( - 'contain', - 'There’s no place like a great home page' - ); - } ); - - it( 'Change the theme from dashboard and then click on esc from keyboard to continue', () => { - cy.exec( 'npx wp-env run cli wp theme activate twentytwentyone' ); - cy.get( '.nfd-onboarding-drawer__panel-menu-link' ).eq( 3 ).click(); // to click on Page Layout - cy.get( '.components-modal__content', { timeout: 40000 } ).should( - 'be.visible' - ); - cy.get( '.components-modal__content' ).type( '{esc}' ); - } ); - - it( 'Check the Heading title of Page Layout', () => { - cy.get( '.nfd-main-heading__title', { timeout: 5000 } ).should( - 'contain', - 'You have ideas, we have page templates' - ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/header-menu.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/header-menu.cy.js deleted file mode 100644 index f64cd5a70..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/header-menu.cy.js +++ /dev/null @@ -1,65 +0,0 @@ -// -import { DrawerActivityForSubMenu } from '../../wp-module-support/drawer.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../../wp-module-support/sidebar.cy'; - -describe( 'Header menu Page', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/design/header-menu' - ); - cy.wait( 10000 ); - } ); - - it( 'Check Drawer Activity', () => { - DrawerActivityForSubMenu( - 'Design', - '.theme-header-menu-preview--drawer', - '.theme-header-menu-preview--drawer__list__item', - 4 - ); - } ); - - it( 'Check to make sure design button is visble', () => { - cy.contains( 'button', 'Design' ).should( 'be.visible' ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__design-header-menu', 'Header & Menu' ); - CheckIllustrationPanel(); - CheckInfoPanel( 2 ); - CheckHelpPanelLinks(); - } ); - - it( 'Check to make sure different design is selected', () => { - let previewCount = 0; - const classname = '.theme-header-menu-preview--drawer__list__item'; - const arr = cy.get( classname ); - arr.each( () => { - cy.get( classname ).eq( previewCount ).click(); - cy.get( classname ) - .eq( previewCount ) - .find( classname.concat( '__title-bar--selected' ) ) - .should( 'be.visible' ); - previewCount += 1; - } ); - } ); - - it( 'Check navigation back button is visible and go one step back', () => { - cy.get( '.navigation-buttons_back' ).should( 'be.visible' ).click(); - cy.wait( 3000 ); - cy.url().should( 'not.contain', '/wp-setup/step/design/header-menu' ); - cy.go( 'back' ); - cy.wait( 3000 ); - } ); - - it( 'Check if Navigation Next button is visible and go one step next', () => { - cy.get( '.navigation-buttons_next' ).should( 'be.visible' ).click(); - cy.wait( 1000 ); - cy.url().should( 'not.contain', '/wp-setup/step/design/header-menu' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/homepage-styles.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/homepage-styles.cy.js deleted file mode 100644 index 6cece6753..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/homepage-styles.cy.js +++ /dev/null @@ -1,53 +0,0 @@ -// - -import { DrawerActivityForMenu } from '../../wp-module-support/drawer.cy'; -import { CheckHeadingSubheading } from '../../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../../wp-module-support/sidebar.cy'; - -describe( 'Homepage Styles Page', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/design/homepage-menu' - ); - cy.wait( 15000 ); - } ); - - it( 'Check if Header and Subheader shows up', () => { - CheckHeadingSubheading(); - } ); - - it( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Onboarding Menu', - ':nth-child(3)', - 'Homepage Layouts' - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__design-homepage', 'Home Page' ); - CheckIllustrationPanel(); - CheckInfoPanel( 2 ); - CheckHelpPanelLinks(); - } ); - - it( 'Check if Homepage Styles exist and are selectable', () => { - let previewCount = 0; - const className = '.homepage_preview__list__item'; - const arr = cy.get( className ); - - arr.each( () => { - cy.get( className ).eq( previewCount ).click(); - cy.get( className ) - .eq( previewCount ) - .find( className.concat( '__title-bar--selected' ) ) - .should( 'be.visible' ); - previewCount += 1; - } ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/site-pages.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/site-pages.cy.js deleted file mode 100644 index 192a618df..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/site-pages.cy.js +++ /dev/null @@ -1,52 +0,0 @@ -// -import { DrawerActivityForMenu } from '../../wp-module-support/drawer.cy'; -import { CheckHeadingSubheading } from '../../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../../wp-module-support/sidebar.cy'; - -describe( 'Site Pages', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/design/site-pages' - ); - cy.wait( 10000 ); - } ); - - it( 'Check if Header and Subheader shows up', () => { - CheckHeadingSubheading(); - } ); - - it( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Onboarding Menu', - ':nth-child(4)', - 'Page Layouts' - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__site-pages', 'Pages' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check if Site Pages Templates exist and are selectable', () => { - let previewCount = 0; - const className = '.site-pages__list__item'; - const arr = cy.get( className ); - - arr.each( () => { - cy.get( className ) - .eq( previewCount ) - .find( '.components-checkbox-control' ) - .find( 'label' ) - .click(); - previewCount += 1; - } ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/theme-styles.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/theme-styles.cy.js deleted file mode 100644 index 37c8a1500..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/theme-styles.cy.js +++ /dev/null @@ -1,124 +0,0 @@ -// -import { DrawerActivityForMenu } from '../../wp-module-support/drawer.cy'; -import { CheckHeadingSubheading } from '../../wp-module-support/header.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../../wp-module-support/sidebar.cy'; - -describe( 'Theme Styles Menu and Preview', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/design/theme-styles/menu' - ); - cy.wait( 5000 ); - } ); - - it( 'Check Drawer Activity', () => { - DrawerActivityForMenu( - 'Onboarding Menu', - ':nth-child(1)', - 'Theme Styles' - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__design-theme-styles-menu', 'Theme Styles' ); - CheckIllustrationPanel(); - CheckInfoPanel( 2 ); - CheckHelpPanelLinks(); - } ); - - it( 'Checks if Heading and Subheading are present', () => { - CheckHeadingSubheading(); - } ); - - it( 'Check if Default Theme variations exists in Menu', () => { - let previewCount = 0; - const className = '.theme-styles-menu__list__item'; - const arr = cy.get( className ); - - arr.each( () => { - cy.get( className.concat( '__title-bar' ) ) - .eq( previewCount ) - .scrollIntoView() - .should( 'be.visible' ); - cy.get( className.concat( '__live-preview-container' ) ) - .eq( previewCount ) - .scrollIntoView() - .should( 'be.visible' ); - previewCount += 1; - } ); - } ); - - it( 'Check if Theme is selected and switches to Preview page', () => { - cy.get( - ':nth-child(2) > .theme-styles-menu__list__item__live-preview-container' - ) - .scrollIntoView() - .should( 'be.visible' ) - .click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/design/theme-styles/menu' - ); - cy.get( ':nth-child(1) > .theme-styles-preview__title-bar' ).should( - 'be.visible' - ); - cy.get( '.theme-styles-preview > div:nth-child(3)' ).should( - 'be.visible' - ); - } ); - - it( 'Check if Theme List is Visible in the Drawer', () => { - let previewCount = 0; - const className = '.theme-styles-preview--drawer__list__item'; - const arr = cy.get( className ); - - arr.each( () => { - cy.get( className.concat( '__title-bar' ) ) - .eq( previewCount ) - .scrollIntoView() - .should( 'be.visible' ); - cy.get( className.concat( '__live-preview-container' ) ) - .eq( previewCount ) - .scrollIntoView() - .should( 'be.visible' ); - previewCount += 1; - } ); - } ); - - it( 'Check for the selected theme in Drawer', () => { - cy.get( '.nfd-onboarding-drawer__panel-back' ) - .scrollIntoView() - .should( 'be.visible' ) - .should( 'have.text', 'Design' ); - const className = - ':nth-child(2) > .theme-styles-preview--drawer__list__item__title-bar'; - cy.get( className ); - cy.get( className + ' > .live-preview-selected-check' ) - .scrollIntoView() - .should( 'be.visible' ); - } ); - - it( 'Check/uncheck Colors and Font Checkbox', () => { - cy.get( '[type=checkbox]' ).click().should( 'be.checked' ); - cy.get( '[type=checkbox]' ).click().should( 'not.be.checked' ); - } ); - - it( 'Check for selected Theme in preview when navigated back to Menu page', () => { - cy.get( '.navigation-buttons_back' ).click(); - cy.url().should( - 'not.include', - '#/wp-setup/step/design/theme-styles/preview' - ); - const className = - ':nth-child(2) > .theme-styles-menu__list__item__title-bar'; - cy.get( className ); - cy.get( className + ' > .live-preview-selected-check' ).should( - 'be.visible' - ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/typography-step.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/typography-step.cy.js deleted file mode 100644 index 3e7c0c104..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/4-design-steps/typography-step.cy.js +++ /dev/null @@ -1,54 +0,0 @@ -// -import { DrawerActivityForSubMenu } from '../../wp-module-support/drawer.cy'; -import { - CheckHelpPanelLinks, - CheckIllustrationPanel, - CheckInfoPanel, - CheckIntroPanel, -} from '../../wp-module-support/sidebar.cy'; - -describe( 'Typography Step Test', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding&flow=ecommerce#/wp-setup/step/design/theme-styles/preview' - ); - } ); - - it( 'Navigate to Typography Step', () => { - cy.wait( 10000 ); - // Have to select the Preview Step Checkbox to activate Colors and Typgoraphy - cy.get( '.navigation-buttons_next' ).click(); - cy.get( '.navigation-buttons_next' ).click(); - cy.wait( 10000 ); - } ); - - it( 'Check Drawer Activity', () => { - DrawerActivityForSubMenu( - 'Design', - '.theme-fonts--drawer', - '.font-palette', - 12 - ); - } ); - - it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__design-typography', 'Typography' ); - CheckIllustrationPanel(); - CheckInfoPanel(); - CheckHelpPanelLinks(); - } ); - - it( 'Check if Default Typography variations exists and are selectable', () => { - let previewCount = 0; - const className = '.font-palette '; - const arr = cy.get( className ); - - arr.each( () => { - cy.get( className ).eq( previewCount ).click(); - cy.get( '.font-palette-selected' ) - .scrollIntoView() - .should( 'be.visible' ); - previewCount += 1; - } ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/sidebar.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/sidebar.cy.js deleted file mode 100644 index 8a035dcd7..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/sidebar.cy.js +++ /dev/null @@ -1,46 +0,0 @@ -// - -describe( 'Sidebar', function () { - before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding#/wp-setup/step/get-started/welcome' - ); - } ); - - it( 'Open sidebar and close with X', () => { - cy.get( '.nfd-onboarding-header__end > .components-button' ) - .click() - .and( 'have.class', 'is-pressed' ); - cy.get( '.nfd-onboarding-sidebar-learn-more' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-sidebar-learn-more__header > button' ).click(); - cy.get( '.nfd-onboarding-sidebar-learn-more' ).should( 'not.exist' ); - } ); - - it( 'Open sidebar and close with `i`', () => { - cy.get( '.nfd-onboarding-header__end > .components-button' ) - .click() - .and( 'have.class', 'is-pressed' ); - cy.get( '.nfd-onboarding-sidebar-learn-more' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-header__end > .components-button' ) - .click() - .and( 'not.have.class', 'is-pressed' ); - cy.get( '.nfd-onboarding-sidebar-learn-more' ).should( 'not.exist' ); - } ); - - it( 'Navigate pages and check if sidebar is open', () => { - cy.get( '.nfd-onboarding-header__end > .components-button' ).click(); - cy.get( '.components-panel__header' ) - .should( 'be.visible' ) - .should( 'have.text', 'Learn More' ); - cy.get( '.navigation-buttons_next' ).click(); - cy.url().should( 'not.include', '#/wp-setup/step/get-started/welcome' ); - cy.get( '.components-panel__header' ).should( 'be.visible' ); - } ); - - it( 'Navigate pages and check if sidebar is closed', () => { - cy.get( '.nfd-onboarding-header__end > .components-button' ).click(); - cy.get( '.components-panel__header' ).should( 'not.exist' ); - cy.go( 'back' ); - cy.get( '.components-panel__header' ).should( 'not.exist' ); - } ); -} ); diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/drawer.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/drawer.cy.js deleted file mode 100644 index 4467c0443..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/drawer.cy.js +++ /dev/null @@ -1,73 +0,0 @@ -// - -export const CheckDrawerDisabled = () => { - cy.get( '.nfd-onboarding-drawer__toggle-button' ) - .click() - .should( 'have.class', 'is-suppressed' ); - cy.get( '.nfd-onboarding-drawer__panel-scroll-container' ) - .scrollIntoView() - .should( 'not.be.visible' ); -}; - -export const DrawerOpen = () => { - cy.get( '.nfd-onboarding-drawer__toggle-button' ).click(); - cy.get( '.nfd-onboarding-drawer__panel-scroll-container' ) - .scrollIntoView() - .should( 'be.visible' ); -}; - -export const DrawerClose = () => { - cy.get( '.nfd-onboarding-drawer__toggle-button' ).click(); - cy.get( '.nfd-onboarding-drawer__panel-scroll-container' ) - .scrollIntoView() - .should( 'not.be.visible' ); -}; - -export const DrawerActivityForMenu = ( - text, - itemPosition, - itemName, - isOpen = true -) => { - let href; - if ( ! isOpen ) { - DrawerOpen(); - } - cy.get( '.nfd-onboarding-drawer__panel-inner' ) - .scrollIntoView() - .should( 'be.visible' ); - cy.get( '.nfd-onboarding-drawer__panel-back' ) - .should( 'be.visible' ) - .should( 'have.text', text ); - cy.get( - itemPosition.concat( ' > .nfd-onboarding-drawer__panel-menu-link' ) - ) - .should( 'have.class', 'active' ) - .should( 'have.text', itemName ) - .and( 'have.attr', 'href' ) - .then( ( value ) => ( href = value ) ); - cy.url().then( ( url ) => { - expect( url ).to.include( href ); - } ); - DrawerClose(); -}; - -export const DrawerActivityForSubMenu = ( - text, - subMenuDrawer, - itemClassName, - itemCount, - isOpen = true -) => { - if ( ! isOpen ) { - DrawerOpen(); - } - cy.get( '.nfd-onboarding-drawer__panel-inner' ) - .scrollIntoView() - .should( 'be.visible' ); - cy.get( '.nfd-onboarding-drawer__panel-back' ) - .should( 'be.visible' ) - .should( 'have.text', text ); - cy.get( subMenuDrawer ).should( 'be.visible' ); - cy.get( itemClassName ).should( 'have.length', itemCount ); -}; diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/header.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/header.cy.js deleted file mode 100644 index 60b881849..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/header.cy.js +++ /dev/null @@ -1,16 +0,0 @@ -// - -export const CheckCardHeadingSubheading = ( question = false ) => { - cy.get( '.nfd-step-card-heading' ).should( 'be.visible' ); - if ( question ) { - cy.get( '.nfd-step-card-subheading-other' ).should( 'be.visible' ); - cy.get( '.nfd-step-card-question' ).should( 'be.visible' ); - } else { - cy.get( '.nfd-step-card-subheading' ).should( 'be.visible' ); - } -}; - -export const CheckHeadingSubheading = () => { - cy.get( '.nfd-main-heading__title' ).should( 'be.visible' ); - cy.get( '.nfd-main-heading__subtitle' ).should( 'be.visible' ); -}; diff --git a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/sidebar.cy.js b/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/sidebar.cy.js deleted file mode 100644 index 49764c53e..000000000 --- a/tests/cypress/integration/z-newfold-labs/wp-module-onboarding/wp-module-support/sidebar.cy.js +++ /dev/null @@ -1,66 +0,0 @@ -// - -export const CheckIntroPanel = ( sidebarStep, headingText ) => { - const prefixSidebarStep = '.nfd-onboarding-sidebar-learn-more'; - cy.get( '.nfd-onboarding-header__end > .components-button' ) - .click() - .and( 'have.class', 'is-pressed' ); - cy.get( prefixSidebarStep.concat( sidebarStep ) ).should( 'be.visible' ); - const heading = prefixSidebarStep.concat( '--step-intro-panel__container' ); - cy.get( heading.concat( '__icon' ) ).should( 'be.visible' ); - cy.get( heading.concat( '__text__heading' ) ) - .should( 'be.visible' ) - .should( 'have.text', headingText ); - cy.get( heading.concat( '__text__heading' ) ).should( 'be.visible' ); -}; - -export const CheckIllustrationPanel = ( - headingTag = '--illustration-panel' -) => { - const heading = '.nfd-onboarding-sidebar-learn-more'.concat( headingTag ); - cy.get( heading.concat( '__container' ) ).should( 'be.visible' ); - cy.get( heading.concat( '__container > div' ) ) - .should( 'be.visible' ) - .should( 'have.css', 'background-image' ); -}; - -export const CheckInfoPanel = ( infoCount = 1 ) => { - cy.get( '.nfd-onboarding-sidebar-learn-more--info-panel' ).should( - 'be.visible' - ); - const infoTag = - '.nfd-onboarding-sidebar-learn-more--heading-with-description'; - cy.get( infoTag.concat( '__heading' ) ) - .should( 'be.visible' ) - .should( 'have.length', infoCount ); - cy.get( infoTag.concat( '__description' ) ) - .should( 'be.visible' ) - .should( 'have.length', infoCount ); -}; - -export const CheckHelpPanelLinks = ( - blueButton = false, - whiteButtonText = 'Hire Our Full-Service Creative Studio', - supportLinkText = 'Technical Support' -) => { - cy.get( '.nfd-onboarding-sidebar-learn-more--help-panel__links' ) - .scrollIntoView() - .should( 'be.visible' ); - if ( blueButton ) { - cy.get( '.nfd-onboarding-button--blue' ) - .should( 'have.text', '1-1 Expert Solutions & Coaching' ) - .should( 'have.attr', 'type' ) - .and( 'match', /button/ ); - } - cy.get( '.nfd-onboarding-button--white' ) - .should( 'have.text', whiteButtonText ) - .should( 'have.attr', 'type' ) - .and( 'match', /button/ ); - cy.get( '.nfd-onboarding-sidebar-learn-more--help-panel__links > a' ) - .should( 'exist' ) - .should( 'have.text', supportLinkText ) - .should( 'have.attr', 'href' ); - cy.get( '.nfd-onboarding-header__end > .components-button' ) - .click() - .and( 'not.have.class', 'is-pressed' ); -}; diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index dfa178629..84540dcbc 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -28,8 +28,6 @@ import '@testing-library/cypress/add-commands'; -const customerData = require('../fixtures/customerData.json'); - Cypress.Commands.add('login', (username, password) => { cy .getCookies() @@ -89,12 +87,3 @@ Cypress.Commands.add('deletePages', () => { } }); }); - -Cypress.Commands.add('setCustomerData', () => { - let cdata = JSON.stringify(customerData).replaceAll(',', '\\,'); - cy.exec(`npx wp-env run cli wp option update bh_cdata_guapi '${cdata}'`); -}); - -Cypress.Commands.add('clearCustomerData', () => { - cy.exec('npx wp-env run cli wp option delete bh_cdata bh_cdata_guapi'); -}); \ No newline at end of file