-
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.
Merge pull request #28 from shopware/feat-add-data-sharing-fixture
feat: add dashboard and data sharing fixture
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 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,27 @@ | ||
import type { Page, Locator } from '@playwright/test'; | ||
import type { PageObject } from '../../types/PageObject'; | ||
|
||
export class Dashboard implements PageObject { | ||
|
||
public readonly dataSharingConsentBanner: Locator; | ||
public readonly dataSharingAgreeButton: Locator; | ||
public readonly dataSharingNotAtTheMomentButton: Locator; | ||
public readonly dataSharingTermsAgreementLabel: Locator; | ||
public readonly dataSharingSettingsLink: Locator; | ||
public readonly dataSharingAcceptMessageText: Locator; | ||
public readonly dataSharingNotAtTheMomentMessageText: Locator; | ||
|
||
constructor(public readonly page: Page) { | ||
this.dataSharingConsentBanner = page.locator('.sw-usage-data-consent-banner'); | ||
this.dataSharingAgreeButton = page.getByRole('button', { name: 'Agree' }); | ||
this.dataSharingNotAtTheMomentButton = page.getByRole('button', { name: 'Not at the moment' }); | ||
this.dataSharingSettingsLink = page.locator('.sw-usage-data-consent-banner-reject-accept-message').getByRole('link'); | ||
this.dataSharingAcceptMessageText = page.getByText('Thank you for your participation!'); | ||
this.dataSharingNotAtTheMomentMessageText = page.getByText('You can at any time enter into the agreement and thus contribute to and profit from the constant evolution of our services'); | ||
this.dataSharingTermsAgreementLabel = page.getByText('By clicking "Agree", you confirm that you are authorized to enter into this agreement on behalf of your company.'); | ||
} | ||
|
||
async goTo() { | ||
await this.page.goto('#/sw/dashboard/index'); | ||
} | ||
} |
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,21 @@ | ||
import type { Page, Locator } from '@playwright/test'; | ||
import type { PageObject } from '../../types/PageObject'; | ||
|
||
export class DataSharing implements PageObject { | ||
|
||
public readonly dataSharingSuccessMessageLabel: Locator; | ||
public readonly dataSharingAgreeButton: Locator; | ||
public readonly dataSharingDisableButton: Locator; | ||
public readonly dataSharingTermsAgreementLabel: Locator; | ||
|
||
constructor(public readonly page: Page) { | ||
this.dataSharingAgreeButton = page.getByRole('button', { name: 'Agree' }); | ||
this.dataSharingDisableButton = page.getByRole('button', { name: 'Disable data sharing' }); | ||
this.dataSharingSuccessMessageLabel = page.getByText('You are sharing data with us', { exact: true }); | ||
this.dataSharingTermsAgreementLabel = page.getByText('By clicking "Agree", you confirm that you are authorized to enter into this agreement on behalf of your company.'); | ||
} | ||
|
||
async goTo() { | ||
await this.page.goto('#/sw/settings/usage/data/index/general'); | ||
} | ||
} |