2020-09-04 02:31:09 +00:00
|
|
|
/**
|
|
|
|
* @format
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { StoreOwnerFlow } from '../../utils/flows';
|
|
|
|
import { completeStoreDetailsSection } from './complete-store-details-section';
|
2021-01-06 22:08:57 +00:00
|
|
|
import {
|
|
|
|
chooseIndustries,
|
|
|
|
completeIndustrySection,
|
|
|
|
} from './complete-industry-section';
|
2020-09-04 02:31:09 +00:00
|
|
|
import { completeProductTypesSection } from './complete-product-types-section';
|
2021-01-06 22:08:57 +00:00
|
|
|
import {
|
|
|
|
completeBusinessSection,
|
|
|
|
completeSelectiveBundleInstallBusinessDetailsTab,
|
2021-03-08 14:23:39 +00:00
|
|
|
unselectAllFeaturesAndContinue,
|
2021-01-06 22:08:57 +00:00
|
|
|
} from './complete-business-section';
|
2020-09-04 02:31:09 +00:00
|
|
|
import { completeThemeSelectionSection } from './complete-theme-selection-section';
|
|
|
|
import { completeBenefitsSection } from './complete-benefits-section';
|
2021-03-08 14:23:39 +00:00
|
|
|
import {
|
|
|
|
clickOnTaskList,
|
|
|
|
getTaskList,
|
|
|
|
onHomescreen,
|
|
|
|
possibleDismissWelcomeModal,
|
|
|
|
TaskTitles,
|
|
|
|
} from './homescreen';
|
|
|
|
import { getElementByText } from './utils';
|
2020-09-04 02:31:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests a default, happy path for the onboarding wizard.
|
|
|
|
*/
|
|
|
|
describe( 'Store owner can complete onboarding wizard', () => {
|
|
|
|
it( 'can log in', StoreOwnerFlow.login );
|
|
|
|
it( 'can start the profile wizard', StoreOwnerFlow.startProfileWizard );
|
|
|
|
it( 'can complete the store details section', completeStoreDetailsSection );
|
|
|
|
it( 'can complete the industry section', completeIndustrySection );
|
|
|
|
it( 'can complete the product types section', completeProductTypesSection );
|
2021-03-08 14:23:39 +00:00
|
|
|
it( 'can complete the business section', async () =>
|
|
|
|
await completeSelectiveBundleInstallBusinessDetailsTab() );
|
|
|
|
it( 'can unselect all business features and contine', async () =>
|
|
|
|
await unselectAllFeaturesAndContinue() );
|
2020-09-04 02:31:09 +00:00
|
|
|
it(
|
|
|
|
'can complete the theme selection section',
|
|
|
|
completeThemeSelectionSection
|
|
|
|
);
|
|
|
|
} );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A non-US store doesn't get the "install recommended features" checkbox.
|
|
|
|
*/
|
2021-03-08 14:23:39 +00:00
|
|
|
describe( 'A spanish store does not get the install recommended features tab, but sees the benefits section', () => {
|
2020-09-04 02:31:09 +00:00
|
|
|
it( 'can log in', StoreOwnerFlow.login );
|
|
|
|
it( 'can start the profile wizard', StoreOwnerFlow.startProfileWizard );
|
|
|
|
it( 'can complete the store details section', async () => {
|
|
|
|
await completeStoreDetailsSection( {
|
2021-03-08 14:23:39 +00:00
|
|
|
countryRegionSubstring: 'spain',
|
|
|
|
countryRegionSelector: 'ES\\:B',
|
|
|
|
countryRegion: 'Spain - Barcelona',
|
2020-09-04 02:31:09 +00:00
|
|
|
} );
|
|
|
|
} );
|
|
|
|
it( 'can complete the industry section', async () => {
|
2020-09-22 12:20:42 +00:00
|
|
|
await completeIndustrySection( 7 );
|
2020-09-04 02:31:09 +00:00
|
|
|
} );
|
|
|
|
it( 'can complete the product types section', completeProductTypesSection );
|
|
|
|
it( 'does not have the install recommended features checkbox', async () => {
|
|
|
|
const installFeaturesCheckbox = await page.$(
|
|
|
|
'#woocommerce-business-extensions__checkbox'
|
|
|
|
);
|
|
|
|
|
|
|
|
expect( installFeaturesCheckbox ).toBe( null );
|
|
|
|
} );
|
2021-03-08 14:23:39 +00:00
|
|
|
it( 'can complete the business section', async () =>
|
|
|
|
await completeBusinessSection() );
|
|
|
|
it(
|
|
|
|
'can complete the theme selection section',
|
|
|
|
completeThemeSelectionSection
|
|
|
|
);
|
|
|
|
it( 'can complete the benefits section', completeBenefitsSection );
|
|
|
|
it( 'should display the choose payments task, and not the woocommerce payments task', async () => {
|
|
|
|
await onHomescreen();
|
|
|
|
await possibleDismissWelcomeModal();
|
|
|
|
const tasks = await getTaskList();
|
|
|
|
expect( tasks ).toContain( TaskTitles.addPayments );
|
|
|
|
expect( tasks ).not.toContain( TaskTitles.wooPayments );
|
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'should not display woocommerce payments as a payments option', async () => {
|
|
|
|
const tasks = await getTaskList();
|
|
|
|
const index = tasks.indexOf( TaskTitles.addPayments );
|
|
|
|
await clickOnTaskList( index );
|
|
|
|
await page.waitForFunction(
|
|
|
|
'document.querySelector(".woocommerce-layout__header-heading").innerText == "Choose payment methods"'
|
|
|
|
);
|
|
|
|
const wcPayLabel = await getElementByText(
|
|
|
|
'h2',
|
|
|
|
'WooCommerce Payments'
|
|
|
|
);
|
|
|
|
expect( wcPayLabel ).toBeUndefined();
|
|
|
|
} );
|
2020-09-04 02:31:09 +00:00
|
|
|
} );
|
2021-01-06 22:08:57 +00:00
|
|
|
|
2021-03-08 14:23:39 +00:00
|
|
|
describe( 'A japanese store can complete the selective bundle install but does not include WCPay. ', () => {
|
2021-01-06 22:08:57 +00:00
|
|
|
it( 'can log in', StoreOwnerFlow.login );
|
|
|
|
it( 'can start the profile wizard', StoreOwnerFlow.startProfileWizard );
|
2021-03-08 14:23:39 +00:00
|
|
|
it( 'can complete the store details section', async () => {
|
|
|
|
await completeStoreDetailsSection( {
|
|
|
|
countryRegionSubstring: 'japan',
|
|
|
|
countryRegionSelector: 'JP\\:JP01',
|
|
|
|
countryRegion: 'Japan — Hokkaido',
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
// JP:JP01
|
2021-01-06 22:08:57 +00:00
|
|
|
it( 'can choose the "Other" industry', async () => {
|
|
|
|
await chooseIndustries( [ 'Other' ] );
|
|
|
|
} );
|
|
|
|
it( 'can complete the product types section', completeProductTypesSection );
|
|
|
|
it( 'can complete the business details tab', async () => {
|
|
|
|
await completeSelectiveBundleInstallBusinessDetailsTab();
|
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'can choose not to install any extensions', async () => {
|
2021-03-08 14:23:39 +00:00
|
|
|
await unselectAllFeaturesAndContinue( false );
|
2021-01-06 22:08:57 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
it(
|
|
|
|
'can finish the rest of the wizard successfully',
|
|
|
|
completeThemeSelectionSection
|
|
|
|
);
|
2021-03-08 14:23:39 +00:00
|
|
|
it( 'should display the choose payments task, and not the woocommerce payments task', async () => {
|
|
|
|
await onHomescreen();
|
|
|
|
await possibleDismissWelcomeModal();
|
|
|
|
const tasks = await getTaskList();
|
|
|
|
expect( tasks ).toContain( TaskTitles.addPayments );
|
|
|
|
expect( tasks ).not.toContain( TaskTitles.wooPayments );
|
|
|
|
} );
|
2021-01-06 22:08:57 +00:00
|
|
|
} );
|