Merge pull request #29565 from woocommerce/e2e/e2e-shopper-my-account-create
Added new e2e test my account create account
This commit is contained in:
commit
e39f2ecd4f
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
# 0.1.3
|
# 0.1.3
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Shopper My Account Create Account
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- removed use of ES6 `import`
|
- removed use of ES6 `import`
|
||||||
|
|
|
@ -77,6 +77,7 @@ The functions to access the core tests are:
|
||||||
- `runSingleProductPageTest` - Shopper can view single product page in many variations (simple, variable, grouped)
|
- `runSingleProductPageTest` - Shopper can view single product page in many variations (simple, variable, grouped)
|
||||||
- `runVariableProductUpdateTest` - Shopper can view and update variations on a variable product
|
- `runVariableProductUpdateTest` - Shopper can view and update variations on a variable product
|
||||||
- `runCheckoutCreateAccountTest` - Shopper can create an account during checkout
|
- `runCheckoutCreateAccountTest` - Shopper can create an account during checkout
|
||||||
|
- `runMyAccountCreateAccountTest` - Shopper can create an account via my account page
|
||||||
|
|
||||||
### REST API
|
### REST API
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ const runCheckoutApplyCouponsTest = require( './shopper/front-end-checkout-coupo
|
||||||
const runCheckoutPageTest = require( './shopper/front-end-checkout.test' );
|
const runCheckoutPageTest = require( './shopper/front-end-checkout.test' );
|
||||||
const runMyAccountPageTest = require( './shopper/front-end-my-account.test' );
|
const runMyAccountPageTest = require( './shopper/front-end-my-account.test' );
|
||||||
const runMyAccountPayOrderTest = require( './shopper/front-end-my-account-pay-order.test' );
|
const runMyAccountPayOrderTest = require( './shopper/front-end-my-account-pay-order.test' );
|
||||||
|
const runMyAccountCreateAccountTest = require( './shopper/front-end-my-account-create-account.test' );
|
||||||
const runSingleProductPageTest = require( './shopper/front-end-single-product.test' );
|
const runSingleProductPageTest = require( './shopper/front-end-single-product.test' );
|
||||||
const runVariableProductUpdateTest = require( './shopper/front-end-variable-product-updates.test' );
|
const runVariableProductUpdateTest = require( './shopper/front-end-variable-product-updates.test' );
|
||||||
const runCheckoutCreateAccountTest = require( './shopper/front-end-checkout-create-account.test' );
|
const runCheckoutCreateAccountTest = require( './shopper/front-end-checkout-create-account.test' );
|
||||||
|
@ -60,6 +61,7 @@ const runShopperTests = () => {
|
||||||
runCheckoutPageTest();
|
runCheckoutPageTest();
|
||||||
runMyAccountPageTest();
|
runMyAccountPageTest();
|
||||||
runMyAccountPayOrderTest();
|
runMyAccountPayOrderTest();
|
||||||
|
runMyAccountCreateAccountTest();
|
||||||
runSingleProductPageTest();
|
runSingleProductPageTest();
|
||||||
runVariableProductUpdateTest();
|
runVariableProductUpdateTest();
|
||||||
runCheckoutCreateAccountTest();
|
runCheckoutCreateAccountTest();
|
||||||
|
@ -133,4 +135,5 @@ module.exports = {
|
||||||
runApiTests,
|
runApiTests,
|
||||||
runAnalyticsPageLoadsTest,
|
runAnalyticsPageLoadsTest,
|
||||||
runCheckoutCreateAccountTest,
|
runCheckoutCreateAccountTest,
|
||||||
|
runMyAccountCreateAccountTest,
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
/* eslint-disable jest/no-export, jest/no-disabled-tests */
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
const {
|
||||||
|
shopper,
|
||||||
|
merchant,
|
||||||
|
setCheckbox,
|
||||||
|
settingsPageSaveChanges,
|
||||||
|
} = require( '@woocommerce/e2e-utils' );
|
||||||
|
|
||||||
|
const runMyAccountCreateAccountTest = () => {
|
||||||
|
describe('Shopper My Account Create Account', () => {
|
||||||
|
beforeAll(async () => {
|
||||||
|
await merchant.login();
|
||||||
|
|
||||||
|
// Set checkbox in the settings to enable registration in my account
|
||||||
|
await merchant.openSettings('account');
|
||||||
|
await setCheckbox('#woocommerce_enable_myaccount_registration');
|
||||||
|
await settingsPageSaveChanges();
|
||||||
|
|
||||||
|
await merchant.logout();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can create a new account via my account', async () => {
|
||||||
|
await shopper.gotoMyAccount();
|
||||||
|
await page.waitForSelector('.woocommerce-form-register');
|
||||||
|
await expect(page).toFill('input#reg_email', 'john.doe.test@example.com');
|
||||||
|
await expect(page).toClick('button[name="register"]');
|
||||||
|
await page.waitForNavigation({waitUntil: 'networkidle0'});
|
||||||
|
await expect(page).toMatchElement('h1', 'My account');
|
||||||
|
|
||||||
|
// Verify user has been created successfully
|
||||||
|
await merchant.login();
|
||||||
|
await merchant.openAllUsersView();
|
||||||
|
await expect(page).toMatchElement('td.email.column-email > a', {text: 'john.doe.test@example.com'});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = runMyAccountCreateAccountTest;
|
|
@ -0,0 +1,6 @@
|
||||||
|
/*
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
const { runMyAccountCreateAccountTest } = require( '@woocommerce/e2e-core-tests' );
|
||||||
|
|
||||||
|
runMyAccountCreateAccountTest();
|
Loading…
Reference in New Issue