Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commerce: add OST tests cases for Jenkins #426

Merged
merged 8 commits into from
Aug 28, 2024

Conversation

afmicka
Copy link
Contributor

@afmicka afmicka commented Aug 26, 2024

Adding tests cases for Offer Selector Tool to be able to run them on Jenkins, but skipping them for any github actions

@afmicka afmicka added the run-nala Run Nala Test Automation against PR/Branch label Aug 26, 2024

const page = await browser.newPage();
// const requestGnavPromise = page.waitForResponse('https://www.adobe.com/libs/blocks/global-navigation/utilities/keyboard/mainNav.js');
await page.goto('https://www.adobe.com/creativecloud/plans.html?mboxDisable=1&adobe_authoring_enabled=true');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure you want this to be run on production?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JackySun9 essentially yes, given that the adobeIMS token can be retrieved from dexter (AEM) pages only. I could run it on www.stage.adobe.com but lot of development testing, pricing changes and milo migrations are ongoing on that environment, preparing for the future. We could run into the need of more frequent maintenance of these tests.

Any specific reason or concern why not to run on prod page?

this.priceStrikethroughUse = page.locator('button:near(:text("Strikethrough price"))').first();
this.checkoutTab = page.locator('//div[@data-key="checkout"]');
this.checkoutLink = page.locator('//a[@data-type="checkoutUrl"]');
// this.workflowMenu = page.locator('//div//label[contains(text(), "Workflow")]');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dli3 Not for now. Removed all commented lines.

features[0].url = 'https://www.adobe.com/creativecloud/plans.html?mboxDisable=1&adobe_authoring_enabled=true';
await ims.fillOutSignInForm(features[0], page);
await page.waitForLoadState('domcontentloaded');
await page.waitForTimeout(3000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using https://playwright.dev/docs/test-assertions#expecttopass might be a good alternative to this fixed delay. It could proceed earlier or wait longer as needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

});

await test.step('Enter Offer ID in the search field', async () => {
await OST.searchField.waitFor({ state: 'visible', timeout: 10000 });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this waitFor line thanks to the fill method's auto-waiting feature. It should wait for the field to be visible out of the box.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Will give it a try. I was just precautious because of the stability.

@afmicka afmicka merged commit 38bbf21 into adobecom:main Aug 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-nala Run Nala Test Automation against PR/Branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants