Skip to content

Commit

Permalink
updated maven, pom, added locator for allure
Browse files Browse the repository at this point in the history
  • Loading branch information
AEkaterina committed Oct 2, 2023
1 parent ae1ea0f commit 6110536
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 29 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,24 @@ jobs:
run: mvn clean test -Daquality.buildName="${{github.event.inputs.build_name}}" -DdriverSettings.${{github.event.inputs.platform_name}}.deviceKey=${{github.event.inputs.device_name_and_version}} -Daquality.suiteName="${{github.event.inputs.platform_name}} - ${{github.event.inputs.test_tag}}" -Daquality.environment="${{github.event.inputs.platform_name}}" -Dcredentials.LYRASISReads."ios".${{secrets.BookCardLyrasis1}}=${{secrets.BookPinLyrasis1}} -Dcredentials.LYRASISReads."ios".${{secrets.BookCardLyrasis2}}=${{secrets.BookPinLyrasis2}} -Dcredentials.LYRASISReads."ios".${{secrets.BookCardLyrasis3}}=${{secrets.BookPinLyrasis3}} -Dcredentials.LYRASISReads."ios".${{secrets.BookCardLyrasis4}}=${{secrets.BookPinLyrasis4}} -Dcredentials.LYRASISReads."android".${{secrets.BookCardLyrasis1}}=${{secrets.BookPinLyrasis1}} -Dcredentials.LYRASISReads."android".${{secrets.BookCardLyrasis2}}=${{secrets.BookPinLyrasis2}} -Dcredentials.LYRASISReads."android".${{secrets.BookCardLyrasis3}}=${{secrets.BookPinLyrasis3}} -Dcredentials.LYRASISReads."android".${{secrets.BookCardLyrasis4}}=${{secrets.BookPinLyrasis4}} -Dcredentials.A1QATestLibrary."ios".${{secrets.BookCardLyrasis1}}=${{secrets.BookPinLyrasis1}} -Dcredentials.A1QATestLibrary."ios".${{secrets.BookCardLyrasis2}}=${{secrets.BookPinLyrasis2}} -Dcredentials.A1QATestLibrary."ios".${{secrets.BookCardLyrasis3}}=${{secrets.BookPinLyrasis3}} -Dcredentials.A1QATestLibrary."ios".${{secrets.BookCardLyrasis4}}=${{secrets.BookPinLyrasis4}} -Dcredentials.A1QATestLibrary."android".${{secrets.BookCardLyrasis1}}=${{secrets.BookPinLyrasis1}} -Dcredentials.A1QATestLibrary."android".${{secrets.BookCardLyrasis2}}=${{secrets.BookPinLyrasis2}} -Dcredentials.A1QATestLibrary."android".${{secrets.BookCardLyrasis3}}=${{secrets.BookPinLyrasis3}} -Dcredentials.A1QATestLibrary."android".${{secrets.BookCardLyrasis4}}=${{secrets.BookPinLyrasis4}} -DremoteConnectionUrl=${{secrets.remoteConnectionUrl}} -DdriverSettings.${{github.event.inputs.platform_name}}.capabilities."browserstack.user"=${{secrets.BROWSERSTACK_USER}} -DdriverSettings.${{github.event.inputs.platform_name}}.capabilities."browserstack.key"=${{secrets.BROWSERSTACK_KEY}} -DplatformName=${{github.event.inputs.platform_name}} -DdriverSettings.${{github.event.inputs.platform_name}}.capabilities.app=${{github.event.inputs.bs_app_link}} -Dcucumber.options="--tags '(${{github.event.inputs.test_tag}} and not @ignore) and not @exclude_${{github.event.inputs.platform_name}}'"
continue-on-error: true

- name: Generate Allure Report
uses: AEkaterina/action-allure-report@v0.1.1
if: success() || failure()
- name: Upload report
uses: actions/upload-artifact@v3
- name: Generate Cucumber JSON Report
run: mvn exec:java -Dexec.mainClass="io.cucumber.core.cli.Main" -Dexec.args="--plugin json:target/cucumber-report.json src/test/resources"

- name: Upload Cucumber JSON Report
uses: actions/upload-artifact@v2
with:
name: allure-report
path: allure-report/
if: success() || failure()
name: cucumber-report
path: target/cucumber-report.json

# - name: Generate Allure Report
# uses: AEkaterina/[email protected]
# if: success() || failure()
# - name: Upload report
# uses: actions/upload-artifact@v3
# with:
# name: allure-report
# path: allure-report/
# if: success() || failure()

# - name: Get Allure history
# uses: actions/checkout@v3
Expand Down
27 changes: 17 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
</configuration>
</plugin>

<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.10.0</version>
</plugin>
<!-- <plugin>-->
<!-- <groupId>io.qameta.allure</groupId>-->
<!-- <artifactId>allure-maven</artifactId>-->
<!-- <version>2.10.0</version>-->
<!-- </plugin>-->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -106,11 +106,11 @@
<version>${cucumber.version}</version>
</dependency>

<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber5-jvm</artifactId>
<version>2.13.2</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.qameta.allure</groupId>-->
<!-- <artifactId>allure-cucumber5-jvm</artifactId>-->
<!-- <version>2.13.2</version>-->
<!-- </dependency>-->

<dependency>
<groupId>com.squareup.retrofit2</groupId>
Expand Down Expand Up @@ -154,5 +154,12 @@
<version>1.3.1</version>
</dependency>

<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>5.7.6</version>
<scope>test</scope>
</dependency>

</dependencies>
</project>
2 changes: 1 addition & 1 deletion src/test/java/features/Search.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Feature: Search module

@allure
@cucumber
Scenario: Find a library and delete it
When Close tutorial screen
And Close welcome screen
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/runners/TestRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
"hooks",
"stepdefinitions"
},
plugin = {
"io.qameta.allure.cucumber5jvm.AllureCucumber5Jvm"
},
tags = "@allure"
// plugin = {
// "io.qameta.allure.cucumber5jvm.AllureCucumber5Jvm"
// },
tags = "@cucumber"
)

public class TestRunner {

@BeforeClass
public static void setup() {
AqualityServices.getLogger().info("Start getting books");
XMLUtil xmlUtil = new XMLUtil();
GettingBookUtil.setXmlUtil(xmlUtil);
GettingBookUtil.printDistributorsInfo();
// XMLUtil xmlUtil = new XMLUtil();
// GettingBookUtil.setXmlUtil(xmlUtil);
// GettingBookUtil.printDistributorsInfo();
AqualityServices.getLogger().info("end getting books");
}
}
10 changes: 7 additions & 3 deletions src/test/java/screens/AlertScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,25 @@ public class AlertScreen extends Screen{
private static final String UNIQUE_ELEMENT_LOCATOR_IOS = "//XCUIElementTypeAlert";
private static final String ACTION_BUTTON_LOCATOR_IOS = UNIQUE_ELEMENT_LOCATOR_IOS + "//XCUIElementTypeButton[@name=\"%s\"]";

private static final String ACTION_BUTTON_LOCATOR_ANDROID = "//android.widget.LinearLayout/android.widget.Button[@text=\"%s\"]";

private final ILabel lblAlertMessage = getElementFactory().getLabel(LocatorUtils.getLocator(
new AndroidLocator(By.xpath("")),
new AndroidLocator(By.id("permission_message")),
new IosLocator(By.xpath(UNIQUE_ELEMENT_LOCATOR_IOS + "//XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeStaticText[1]"))), "Alert message");
private final ILabel lblNotificationAlert = getElementFactory().getLabel(LocatorUtils.getLocator(
new AndroidLocator(By.xpath("")),
new IosLocator(By.xpath("//XCUIElementTypeAlert[contains(@name, \"Send You Notifications\")]"))), "Alert to allow notifications");

public AlertScreen() {
super(LocatorUtils.getLocator(
new AndroidLocator(By.xpath("")),
new AndroidLocator(By.xpath("//android.widget.LinearLayout[contains(@resource-id, \"grant_dialog\")]")),
new IosLocator(By.xpath("//XCUIElementTypeAlert"))), "Alert screen");
}

public void waitAndPerformAlertActionIfDisplayed(ActionButtonsForBooksAndAlertsKeys actionButtonNamesAlertKeys) {
IButton actionButton = getElementFactory().getButton(By.xpath(String.format(ACTION_BUTTON_LOCATOR_IOS, actionButtonNamesAlertKeys.getDefaultLocalizedValue())), String.format("%s Action button alert", actionButtonNamesAlertKeys.getDefaultLocalizedValue()));
IButton actionButton = getElementFactory().getButton(LocatorUtils.getLocator(
new AndroidLocator(By.xpath(String.format(ACTION_BUTTON_LOCATOR_ANDROID, actionButtonNamesAlertKeys.getDefaultLocalizedValue()))),
new IosLocator(By.xpath(String.format(ACTION_BUTTON_LOCATOR_IOS, actionButtonNamesAlertKeys.getDefaultLocalizedValue())))), String.format("%s Action button alert", actionButtonNamesAlertKeys.getDefaultLocalizedValue()));
if(actionButton.state().waitForDisplayed()){
actionButton.click();
}
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/cucumber.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cucumber.options=--plugin json:target/cucumber-report.json

0 comments on commit 6110536

Please sign in to comment.