-
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.
TestNG template project with allure report (#24)
* TestNG template project with allure report * Remove unused method and rename AlertSteps * add missed env vars to ios job * Rework test name listener to correct name in allure report * Terminate app before quitting the driver * Update package and terminate app callings * Update pipeline to run on macos-12 * Fix workflow triggers - on PR - path * Stabilize test on Android * Exclude old guice from cucumber project. Increase retries count * Increase timeouts
- Loading branch information
Showing
31 changed files
with
458 additions
and
88 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
2 changes: 0 additions & 2 deletions
2
...ate-cucumber/src/test/java/aquality/appium/mobile/template/cucumber/features/Demo.feature
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
18 changes: 0 additions & 18 deletions
18
.../test/java/aquality/appium/mobile/template/cucumber/objectfactory/CustomMobileModule.java
This file was deleted.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
...er/src/test/java/aquality/appium/mobile/template/cucumber/stepdefinitions/AlertSteps.java
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,32 @@ | ||
package aquality.appium.mobile.template.cucumber.stepdefinitions; | ||
|
||
import aquality.appium.mobile.screens.screenfactory.IScreenFactory; | ||
import aquality.appium.mobile.template.screens.Alert; | ||
import io.cucumber.java.en.Then; | ||
import io.cucumber.java.en.When; | ||
|
||
import javax.inject.Inject; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.assertTrue; | ||
|
||
public class AlertSteps { | ||
|
||
private final Alert alert; | ||
|
||
@Inject | ||
public AlertSteps(IScreenFactory screenFactory) { | ||
alert = screenFactory.getScreen(Alert.class); | ||
} | ||
|
||
@Then("'{}' alert appears") | ||
public void alertAppears(String alertMessage) { | ||
assertTrue(alert.state().waitForDisplayed(), "Alert appeared"); | ||
assertEquals(alert.getMessage(), alertMessage, "Alert message is correct"); | ||
} | ||
|
||
@When("I accept the alert") | ||
public void acceptAlert() { | ||
alert.tapOk(); | ||
} | ||
} |
51 changes: 0 additions & 51 deletions
51
...r/src/test/java/aquality/appium/mobile/template/cucumber/stepdefinitions/CommonSteps.java
This file was deleted.
Oops, something went wrong.
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,58 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.github.aquality-automation</groupId> | ||
<artifactId>aquality-appium-mobile-java-template-project</artifactId> | ||
<version>1.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>aquality-appium-mobile-template-testng</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.github.aquality-automation</groupId> | ||
<artifactId>aquality-appium-mobile-template</artifactId> | ||
<version>1.0.1-SNAPSHOT</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<version>7.9.0</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.qameta.allure</groupId> | ||
<artifactId>allure-testng</artifactId> | ||
<version>${allure.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<version>3.25.3</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<version>2.0.10</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
8 changes: 8 additions & 0 deletions
8
...-testng/src/test/java/aquality/appium/mobile/template/testng/constants/AlertMessages.java
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,8 @@ | ||
package aquality.appium.mobile.template.testng.constants; | ||
|
||
import lombok.experimental.UtilityClass; | ||
|
||
@UtilityClass | ||
public class AlertMessages { | ||
public static final String INVALID_CREDENTIALS = "Invalid login credentials, please try again"; | ||
} |
8 changes: 8 additions & 0 deletions
8
...late-testng/src/test/java/aquality/appium/mobile/template/testng/constants/ViewNames.java
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,8 @@ | ||
package aquality.appium.mobile.template.testng.constants; | ||
|
||
import lombok.experimental.UtilityClass; | ||
|
||
@UtilityClass | ||
public class ViewNames { | ||
public static final String LOGIN_SCREEN = "Login Screen"; | ||
} |
26 changes: 26 additions & 0 deletions
26
...emplate-testng/src/test/java/aquality/appium/mobile/template/testng/steps/AlertSteps.java
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,26 @@ | ||
package aquality.appium.mobile.template.testng.steps; | ||
|
||
import aquality.appium.mobile.template.screens.Alert; | ||
import io.qameta.allure.Step; | ||
|
||
import javax.inject.Inject; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.assertTrue; | ||
|
||
public class AlertSteps { | ||
|
||
@Inject | ||
private Alert alert; | ||
|
||
@Step("'{alertMessage}' alert appears") | ||
public void checkAlertAppears(String alertMessage) { | ||
assertTrue(alert.state().waitForDisplayed(), "Alert appeared"); | ||
assertEquals(alert.getMessage(), alertMessage, "Alert message is correct"); | ||
} | ||
|
||
@Step("I accept the alert") | ||
public void acceptAlert() { | ||
alert.tapOk(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...te-testng/src/test/java/aquality/appium/mobile/template/testng/steps/ChooseViewSteps.java
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,17 @@ | ||
package aquality.appium.mobile.template.testng.steps; | ||
|
||
import aquality.appium.mobile.template.screens.chooseview.ChooseViewScreen; | ||
import io.qameta.allure.Step; | ||
|
||
import javax.inject.Inject; | ||
|
||
public class ChooseViewSteps { | ||
|
||
@Inject | ||
private ChooseViewScreen chooseViewScreen; | ||
|
||
@Step("I open '{viewName}' view") | ||
public void openView(String viewName) { | ||
chooseViewScreen.openView(viewName); | ||
} | ||
} |
Oops, something went wrong.