-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* PMM-12847 Automation for product tour * PMM-12847 Correct test tag * PMM-12847 Removes skipped test * PMM-12847: Added Test numbers. * PMM-12847: Scenario .only for testing purposes * PMM-13040: Adds special tags for the pmm tour. * PMM-13040: Adds special tags for the pmm tour. * PMM-13040: changes wait for navigation * PMM-12847: Wait For Navigation fix * PMM-12847: Removes unused test flag * PMM-12847: Fix for networkidle0 * PMM-12847: Changes requested in the PR
- Loading branch information
1 parent
e86f9fa
commit 48adfdf
Showing
5 changed files
with
109 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const { I } = inject(); | ||
|
||
class ProductTourComponent { | ||
constructor() { | ||
this.productTourModal = locate('//h2[text()="Welcome to Percona Monitoring and Management (PMM)"]//ancestor::div[@role="dialog"]'); | ||
this.skipButton = this.productTourModal.find('//span[text()="Skip"]'); | ||
this.laterButton = this.productTourModal.find('//span[text()="Check later"]'); | ||
this.closeButton = this.productTourModal.find('//button[@aria-label="Close"]'); | ||
this.startTourButton = this.productTourModal.find('//span[text()="Start tour"]'); | ||
this.nextStepButton = locate('//button[@aria-label="Next step"]'); | ||
this.tourStepHeader = (headerText) => locate(`//div[@class="pmm-tour"]//strong[text()="${headerText}"]`); | ||
this.productTourCategories = ['Dashboards', 'PMM Dashboards', 'PMM Query Analytics', 'Explore', 'Alerting', 'Advisors', 'Backup', 'PMM Configuration Panel', 'Administration']; | ||
this.tourDoneButton = locate('//button//span[text()="Done"]'); | ||
} | ||
|
||
async verifyProductTourSteps() { | ||
const lastStepHeaderText = this.productTourCategories[this.productTourCategories.length - 1]; | ||
|
||
for (const headerText of this.productTourCategories) { | ||
I.waitForElement(this.tourStepHeader(headerText), 10); | ||
if (headerText === lastStepHeaderText) { | ||
I.dontSeeElement(this.nextStepButton); | ||
I.click(this.tourDoneButton); | ||
} else { | ||
I.dontSeeElement(this.tourDoneButton); | ||
I.click(this.nextStepButton); | ||
} | ||
} | ||
} | ||
} | ||
|
||
module.exports = new ProductTourComponent(); | ||
module.exports.ProductTourDialog = ProductTourComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Feature('Pmm Product tour tests'); | ||
|
||
Before(async ({ I }) => { | ||
await I.stopMockingProductTourApi(); | ||
await I.Authorize(); | ||
await I.sendGetRequest('v1/user', { Authorization: `Basic ${await I.getAuth()}` }); | ||
}); | ||
|
||
Scenario('PMM-T1879 Verify that product tour dialog is displayed after check later button pressed. @grafana-pr', async ({ I, homePage }) => { | ||
await I.amOnPage(''); | ||
await I.waitForElement(homePage.productTour.laterButton); | ||
await I.click(homePage.productTour.laterButton); | ||
await I.refreshPage(); | ||
await I.waitForElement(homePage.productTour.productTourModal, 10); | ||
}).config('Playwright', { waitForNavigation: 'load' }); | ||
|
||
Scenario('PMM-T1880 Verify that product tour dialog is displayed after closing @grafana-pr', async ({ I, homePage }) => { | ||
await I.amOnPage(''); | ||
await I.waitForElement(homePage.productTour.closeButton); | ||
await I.click(homePage.productTour.closeButton); | ||
await I.refreshPage(); | ||
await I.waitForElement(homePage.productTour.productTourModal, 10); | ||
}).config('Playwright', { waitForNavigation: 'load' }); | ||
|
||
Scenario('PMM-T1881 Verify that product tour dialog contains all the components. @grafana-pr', async ({ I, homePage }) => { | ||
await I.amOnPage(''); | ||
await I.waitForElement(homePage.productTour.startTourButton); | ||
await I.click(homePage.productTour.startTourButton); | ||
await homePage.productTour.verifyProductTourSteps(); | ||
await I.waitForDetached(homePage.productTour.productTourModal); | ||
}).config('Playwright', { waitForNavigation: 'load' }); | ||
|
||
Scenario('PMM-T1882 Verify that product tour dialog is not displayed after skipping @grafana-pr', async ({ I, homePage }) => { | ||
await I.enableProductTour(); | ||
await I.amOnPage(''); | ||
|
||
await I.waitForElement(homePage.productTour.skipButton); | ||
await I.click(homePage.productTour.skipButton); | ||
await I.stopMockingProductTourApi(); | ||
|
||
await I.refreshPage(); | ||
|
||
await I.waitForElement(homePage.elements.pageContent); | ||
await I.waitForDetached(homePage.productTour.productTourModal, 10); | ||
}).config('Playwright', { waitForNavigation: 'load' }); |
This file was deleted.
Oops, something went wrong.