-
Notifications
You must be signed in to change notification settings - Fork 5
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
PMM-12847 Grafana 10 Product tour automation #765
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
41c7e50
PMM-12847 Automation for product tour
peterSirotnak 1e5a591
PMM-12847 Correct test tag
peterSirotnak 6a59f7a
PMM-12847 Removes skipped test
peterSirotnak b94eb75
PMM-12847: Added Test numbers.
peterSirotnak ffb7188
PMM-12847: Scenario .only for testing purposes
peterSirotnak 3181cd8
PMM-13040: Adds special tags for the pmm tour.
peterSirotnak 7c90fe5
PMM-13040: Adds special tags for the pmm tour.
peterSirotnak 2e13b4b
PMM-13040: changes wait for navigation
peterSirotnak 8860112
PMM-12847: Wait For Navigation fix
peterSirotnak 07dabc2
PMM-12847: Removes unused test flag
peterSirotnak fda2eee
PMM-12847: Fix for networkidle0
peterSirotnak 15a574a
PMM-12847: Changes requested in the PR
peterSirotnak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,30 @@ | ||
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() { | ||
for await (const [index, headerText] of this.productTourCategories.entries()) { | ||
await I.waitForElement(this.tourStepHeader(headerText), 10); | ||
|
||
if (index + 1 === this.productTourCategories.length) { | ||
await I.click(this.tourDoneButton); | ||
} else { | ||
await 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); | ||
}); | ||
|
||
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); | ||
}); | ||
|
||
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); | ||
}); | ||
|
||
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); | ||
}); |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it adds extra verification and I believe improves readability. What do you think @peterSirotnak ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that is adds another level of verification but I do not think it is needed Its hardly possible to both buttons to be visible and for me it does not look more readable.