Skip to content

Commit

Permalink
Removed old form template test. (#384)
Browse files Browse the repository at this point in the history
Co-authored-by: Dennis Li <[email protected]>
  • Loading branch information
Dli3 and Dennis Li authored Jun 26, 2024
1 parent d507172 commit d32395d
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 375 deletions.
58 changes: 10 additions & 48 deletions features/milo/marketo.block.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,22 @@ module.exports = {
features: [
{
tcid: '0',
name: '@marketo production form',
path: '/drafts/nala/blocks/marketo/marketo-mcz-production-2277',
tags: '@marketo @marketoProductionForm @milo @smoke @regression',
},
{
tcid: '1',
name: '@marketo rfi template',
path: '/drafts/nala/blocks/marketo/content-rfi-template',
tags: '@marketo @marketoRFITemplate @milo @smoke @regression',
},
{
tcid: '2',
name: '@marketo discover template',
path: '/drafts/nala/blocks/marketo/content-discover-template',
tags: '@marketo @marketoDiscoverTemplate @milo @smoke @regression',
},
{
tcid: '3',
name: '@marketo explore template',
path: '/drafts/nala/blocks/marketo/content-explore-template',
tags: '@marketo @marketoExploreTemplate @milo @smoke @regression',
},
{
tcid: '4',
name: '@marketo evaluate template',
path: '/drafts/nala/blocks/marketo/content-evaluate-template',
tags: '@marketo @marketoEvaluateTemplate @milo @smoke @regression',
},
{
tcid: '5',
name: '@marketo webinar template',
path: '/drafts/nala/blocks/marketo/content-webinar-template',
tags: '@marketo @marketoWebinarTemplate @milo @smoke @regression',
},
{
tcid: '6',
name: '@marketo trial template',
path: '/drafts/nala/blocks/marketo/content-trial-template',
tags: '@marketo @marketoTrialTemplate @milo @smoke @regression',
},
{
tcid: '7',
name: '@marketo full template',
path: '/drafts/nala/blocks/marketo/full',
path: [
'/drafts/nala/blocks/marketo/full',
],
tags: '@marketo @marketoFullTemplate @milo @smoke @regression',
},
{
tcid: '8',
name: '@marketo full template',
path: '/drafts/nala/blocks/marketo/full-with-company-type',
tcid: '1',
name: '@marketo full template with company type',
path: [
'/drafts/nala/blocks/marketo/full-with-company-type',
],
tags: '@marketo @marketoFullTemplate @milo @smoke @regression',
},
{
tcid: '9',
tcid: '2',
name: '@marketo expanded template',
path: [
'/drafts/nala/blocks/marketo/expanded',
Expand All @@ -65,7 +27,7 @@ module.exports = {
tags: '@marketo @marketoExpandedTemplate @milo @smoke @regression',
},
{
tcid: '10',
tcid: '3',
name: '@marketo essential template',
path: [
'/drafts/nala/blocks/marketo/essential',
Expand Down
133 changes: 12 additions & 121 deletions selectors/milo/marketo.block.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ const LAST_NAME = 'lastNameTest';
const PHONE = '415-123-4567';
const EMAIL = '[email protected]';
const COMPANY = 'Adobe';
const COUNTRY = 'United States';
const STATE = 'California';
const POSTAL_CODE = '94111';
const JOB_TITLE = 'Other';
const PRIMARY_PRODUCT_INTEREST = 'Digital marketing';
const FUNCTIONAL_AREA = 'Other';
const COMPANY_TYPE = 'Other';

export default class Marketo {
constructor(page) {
Expand All @@ -38,118 +32,15 @@ export default class Marketo {
this.submitButton = this.marketo.locator('#mktoButton_new');
}

/**
* @description Checks that the form fields display.
* Checking the fields that all form IDs have.
*/
async checkFieldsDisplays() {
await expect(this.country).toBeVisible({ timeout: 10000 });
await expect(this.firstName).toBeVisible();
await expect(this.lastName).toBeVisible();
await expect(this.email).toBeVisible();
await expect(this.company).toBeVisible();
await expect(this.submitButton).toBeVisible();
}

/**
* @description Form ID: MCZ Production (2277)
*/
async submitProductionForm() {
await this.country.selectOption(COUNTRY);
await this.functionalArea.selectOption(FUNCTIONAL_AREA);
await this.jobTitle.selectOption(JOB_TITLE);
await this.primaryProductInterest.selectOption(PRIMARY_PRODUCT_INTEREST);
await this.state.selectOption(STATE);
await this.firstName.fill(FIRST_NAME);
await this.lastName.fill(LAST_NAME);
await this.email.fill(EMAIL);
await this.phone.fill(PHONE);
await this.company.fill(COMPANY);
await this.postalCode.fill(POSTAL_CODE);
await this.submitButton.click();
}
async submitFullTemplateForm(poi) {
await this.country.selectOption({ index: 1 });
await this.functionalArea.selectOption({ index: 1 });
await this.jobTitle.selectOption({ index: 1 });

async submitRFITemplateForm() {
await this.country.selectOption(COUNTRY);
await this.functionalArea.selectOption(FUNCTIONAL_AREA);
await this.jobTitle.selectOption(JOB_TITLE);
await this.primaryProductInterest.selectOption(PRIMARY_PRODUCT_INTEREST);
await this.state.selectOption(STATE);
await this.company.fill(COMPANY);
await this.firstName.fill(FIRST_NAME);
await this.lastName.fill(LAST_NAME);
await this.email.fill(EMAIL);
await this.phone.fill(PHONE);
await this.postalCode.fill(POSTAL_CODE);
await this.submitButton.click();
}

async submitDiscoverTemplateForm() {
await this.country.selectOption(COUNTRY);
await this.email.fill(EMAIL);
await this.company.fill(COMPANY);
await this.submitButton.click();
}

async submitExploreTemplateForm() {
await this.country.selectOption(COUNTRY);
await this.functionalArea.selectOption(FUNCTIONAL_AREA);
await this.jobTitle.selectOption(JOB_TITLE);
await this.firstName.fill(FIRST_NAME);
await this.lastName.fill(LAST_NAME);
await this.email.fill(EMAIL);
await this.company.fill(COMPANY);
await this.submitButton.click();
}

async submitEvaluateTemplateForm() {
await this.country.selectOption(COUNTRY);
await this.functionalArea.selectOption(FUNCTIONAL_AREA);
await this.jobTitle.selectOption(JOB_TITLE);
await this.state.selectOption(STATE);
await this.firstName.fill(FIRST_NAME);
await this.lastName.fill(LAST_NAME);
await this.email.fill(EMAIL);
await this.company.fill(COMPANY);
await this.phone.fill(PHONE);
await this.postalCode.fill(POSTAL_CODE);
await this.submitButton.click();
}

async submitWebinarTemplateForm() {
await this.country.selectOption(COUNTRY);
await this.functionalArea.selectOption(FUNCTIONAL_AREA);
await this.jobTitle.selectOption(JOB_TITLE);
await this.state.selectOption(STATE);
await this.firstName.fill(FIRST_NAME);
await this.lastName.fill(LAST_NAME);
await this.email.fill(EMAIL);
await this.phone.fill(PHONE);
await this.company.fill(COMPANY);
await this.postalCode.fill(POSTAL_CODE);
await this.submitButton.click();
}

async submitTrialTemplateForm() {
await this.functionalArea.selectOption(FUNCTIONAL_AREA);
await this.country.selectOption(COUNTRY);
await this.jobTitle.selectOption(JOB_TITLE);
await this.state.selectOption(STATE);
await this.firstName.fill(FIRST_NAME);
await this.lastName.fill(LAST_NAME);
await this.email.fill(EMAIL);
await this.phone.fill(PHONE);
await this.company.fill(COMPANY);
await this.postalCode.fill(POSTAL_CODE);
await this.submitButton.click();
}
// Setting index 2 to test so that the 'Company Type' field doesn't display
await this.primaryProductInterest.selectOption(poi !== undefined ? poi : { index: 2 });

async submitFullTemplateForm(poi = PRIMARY_PRODUCT_INTEREST) {
await this.country.selectOption(COUNTRY);
await this.functionalArea.selectOption(FUNCTIONAL_AREA);
await this.jobTitle.selectOption(JOB_TITLE);
await this.primaryProductInterest.selectOption(poi);
await this.state.selectOption(STATE);
await this.state.selectOption({ index: 1 });
await this.company.fill(COMPANY);
await this.firstName.fill(FIRST_NAME);
await this.lastName.fill(LAST_NAME);
Expand All @@ -161,9 +52,9 @@ export default class Marketo {
}

async submitExpandedTemplateForm() {
await this.country.selectOption(COUNTRY);
await this.functionalArea.selectOption(FUNCTIONAL_AREA);
await this.jobTitle.selectOption(JOB_TITLE);
await this.country.selectOption({ index: 1 });
await this.functionalArea.selectOption({ index: 1 });
await this.jobTitle.selectOption({ index: 1 });
await this.firstName.fill(FIRST_NAME);
await this.lastName.fill(LAST_NAME);
await this.email.fill(EMAIL);
Expand All @@ -173,7 +64,7 @@ export default class Marketo {
}

async submitEssentialTemplateForm() {
await this.country.selectOption(COUNTRY);
await this.country.selectOption({ index: 1 });
await this.firstName.fill(FIRST_NAME);
await this.lastName.fill(LAST_NAME);
await this.email.fill(EMAIL);
Expand All @@ -194,7 +85,7 @@ export default class Marketo {
const expectedPOI = ['Commerce', 'ADOBEADVERTISINGCLOUD'];

if (expectedPOI.includes(await this.getPOI())) {
this.companyType.selectOption(COMPANY_TYPE);
this.companyType.selectOption({ index: 1 });
}
}

Expand Down
Loading

0 comments on commit d32395d

Please sign in to comment.