This repository has been archived by the owner on May 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
with scenario and implementation to realize scenarios with two independent browser windows
- Loading branch information
Showing
6 changed files
with
91 additions
and
13 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
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
36 changes: 36 additions & 0 deletions
36
src/test/kotlin/at/co/boris/secuton/step_definitions/SessionSteps.kt
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,36 @@ | ||
package at.co.boris.secuton.step_definitions | ||
|
||
import assertk.assertThat | ||
import assertk.assertions.endsWith | ||
import assertk.assertions.isEqualTo | ||
import at.co.boris.secuton.pageobjects.MainPage | ||
import at.co.boris.secuton.pageobjects.PageUrls | ||
import at.co.boris.secuton.pageobjects.TeamPage | ||
|
||
class SessionSteps(testDataContainer: TestDataContainer) : AbstractStepDefs(testDataContainer) { | ||
|
||
|
||
init { | ||
When("the start page for {string} is loaded") { sessionID: String -> | ||
getWebDriverSession(sessionID).gotoUrl(PageUrls.HOME, MainPage::class, testDataContainer) | ||
} | ||
|
||
When("{string} is activated") { sessionID: String -> | ||
getWebDriverSession(sessionID) | ||
} | ||
When("{string} opens the team site") { sessionID: String -> | ||
getWebDriverSession(sessionID).gotoUrl(PageUrls.TEAM,TeamPage::class, testDataContainer) | ||
} | ||
Then("{string} should be still on start page") { sessionID: String -> | ||
assertThat(getWebDriverSession(sessionID).webDriver.currentUrl).isEqualTo((testDataContainer.getTestData("baseurl") as String) + "/") | ||
} | ||
|
||
Then("the active session should contain {int} window") { expCount: Int -> | ||
assertThat(getWebDriverSession().webDriver.windowHandles.size).isEqualTo(expCount) | ||
} | ||
|
||
And("{string} should be still on team site") { sessionID: String -> | ||
assertThat(getWebDriverSession(sessionID).webDriver.currentUrl).endsWith(PageUrls.TEAM.subUrl + "/") | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,14 +1,20 @@ | ||
@boris | ||
Feature: [peso] Example Feature | ||
|
||
Background: | ||
Scenario: [PES-01 [peso] | ||
Given the start page is loaded | ||
|
||
Scenario: [HWD-01 [peso] | ||
Then the peso logo should be displayed | ||
|
||
Scenario: [HWD-02 [peso] | ||
Scenario: [PES-02 [peso] | ||
Given the start page is loaded | ||
When the team site is opened | ||
Then should "Boris Wrubel" be part of the Core team | ||
|
||
Scenario: [PES-03 [peso] | ||
Given the start page for "User_1" is loaded | ||
And the start page for "User_2" is loaded | ||
Then the active session should contain 1 window | ||
When "User_2" opens the team site | ||
Then "User_1" should be still on start page | ||
And "User_2" should be still on team site | ||
|