-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c20759
commit e6da3f2
Showing
4 changed files
with
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature: Swaglabs app footer component | ||
|
||
Scenario Outline: As a standard user, I can order the product | ||
|
||
Given I am logged in the app | ||
When I scroll to the app footer | ||
Then App footer is displayed | ||
And I will see footer social media links | ||
And I will see footer corporation information title <title> and subtitle <subtitle> | ||
Examples: | ||
| title | subtitle | | ||
| © 2022 Sauce Labs. All Rights Reserved. | Terms of Service \| Privacy Policy | |
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,41 @@ | ||
class FooterComponent { | ||
|
||
private readonly footerContainerLocator = "//android.widget.ScrollView[@content-desc=\"test-PRODUCTS\"]/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup"; | ||
|
||
private get twitterLink() { | ||
return $(`${this.footerContainerLocator}/android.widget.TextView[1]`); | ||
} | ||
|
||
private get facebookLink() { | ||
return $(`${this.footerContainerLocator}/android.widget.TextView[2]`); | ||
} | ||
|
||
private get googlePlusLink() { | ||
return $(`${this.footerContainerLocator}/android.widget.TextView[3]`); | ||
} | ||
|
||
private get linkedinLink() { | ||
return $(`${this.footerContainerLocator}/android.widget.TextView[4]`); | ||
} | ||
|
||
public get container() { | ||
return $(this.footerContainerLocator); | ||
} | ||
|
||
public get corpInfoTitle() { | ||
return $("//*[@text=\"© 2022 Sauce Labs. All Rights Reserved.\"]"); | ||
} | ||
|
||
public get corpInfoSubTitle() { | ||
return $("//*[@text=\"Terms of Service | Privacy Policy\"]"); | ||
} | ||
|
||
public async checkFooterLinkIsDisplayed() { | ||
await expect(await this.twitterLink).toBeDisplayed(); | ||
await expect(await this.facebookLink).toBeDisplayed(); | ||
await expect(await this.googlePlusLink).toBeDisplayed(); | ||
await expect(await this.linkedinLink).toBeDisplayed(); | ||
} | ||
} | ||
|
||
export default new FooterComponent(); |
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,21 @@ | ||
import {Then, When} from "@wdio/cucumber-framework"; | ||
import Swipe from "../pageobjects/Swipe"; | ||
import InventoryPage from "../pageobjects/pages/InventoryPage"; | ||
|
||
When(/^I scroll to the app footer$/, async () => { | ||
await Swipe.down(); | ||
await Swipe.down(); | ||
}); | ||
|
||
Then(/^App footer is displayed$/, async () => { | ||
await expect(await InventoryPage.footer.container).toBeDisplayed(); | ||
}); | ||
|
||
Then(/^I will see footer social media links$/, async () => { | ||
await InventoryPage.footer.checkFooterLinkIsDisplayed(); | ||
}); | ||
|
||
Then(/^I will see footer corporation information title (.*) and subtitle (.*)$/, async (title, subTitle) => { | ||
await expect(await (await InventoryPage.footer.corpInfoTitle).getText()).toEqual(title); | ||
await expect(await (await InventoryPage.footer.corpInfoSubTitle).getText()).toEqual(subTitle); | ||
}); |