Skip to content

Commit

Permalink
Merge pull request #45 from axonivy-market/webtest14
Browse files Browse the repository at this point in the history
Webtest14
  • Loading branch information
ivy-rew authored Oct 27, 2023
2 parents cd3d4fa + 3bf7d6d commit 920c69c
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 17 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Dev-Build

on:
push:
schedule:
- cron: '21 21 * * *'
workflow_dispatch:

jobs:
build:
uses: axonivy-market/github-workflows/.github/workflows/dev.yml@v2
with:
mvnArgs: -Dwebtester.version=11.2.0-SNAPSHOT
4 changes: 2 additions & 2 deletions persistence-utils-demo-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependency>
<groupId>com.axonivy.ivy.test</groupId>
<artifactId>unit-tester</artifactId>
<version>10.0.0</version>
<version>10.0.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -44,7 +44,7 @@
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>10.0.6</version>
<version>10.0.14</version>
<extensions>true</extensions>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion persistence-utils-demo-tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>10.0.6</version>
<version>10.0.14</version>
<extensions>true</extensions>
</plugin>
</plugins>
Expand Down
16 changes: 14 additions & 2 deletions persistence-utils-demo-webtest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
<version>10.0.5-SNAPSHOT</version>
<packaging>iar-integration-test</packaging>
<description>Web Test project of the persistence utils demo project.</description>
<properties>
<webtester.version>10.0.14</webtester.version>
</properties>
<repositories>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.axonivy.utils.persistence</groupId>
Expand All @@ -16,7 +28,7 @@
<dependency>
<groupId>com.axonivy.ivy.webtest</groupId>
<artifactId>web-tester</artifactId>
<version>10.0.0</version>
<version>${webtester.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -26,7 +38,7 @@
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>10.0.6</version>
<version>10.0.14</version>
<extensions>true</extensions>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.axonivy.ivy.webtest.IvyWebTest;
import com.axonivy.ivy.webtest.engine.EngineUrl;
import com.axonivy.ivy.webtest.engine.WebAppFixture;
import com.axonivy.ivy.webtest.primeui.PrimeUi;
import com.axonivy.ivy.webtest.primeui.widget.InputNumber;
import com.codeborne.selenide.ElementsCollection;
Expand Down Expand Up @@ -47,15 +48,13 @@ public static void setup() {
firstName = "Peter" + randomNumber;
lastName = "S" + randomNumber;
ivyUserName = firstName.toLowerCase() + "." + lastName.toLowerCase();

startLoginAsAdmin();
}


@Test
@Order(1)
public void testAddNewDepartment() {
startLoginAsAdmin(); //re-login
public void testAddNewDepartment(WebAppFixture fixture) {
startLoginAsAdmin(fixture); //re-login
addNewDepartment(marketingDepartmentName);

$(By.id("mainForm:departmentTable_data")).shouldHave(text(marketingDepartmentName));
Expand Down Expand Up @@ -183,12 +182,8 @@ private void startProcessPersonSearch() {
open(EngineUrl.createProcessUrl("persistence-utils-demo/173A4BC5D38BAD52/personSearch.ivp"));
}

private static void startLoginAsAdmin() {
open(EngineUrl.base() + "default-workflow/faces/login.xhtml");

$(By.id("loginForm:userName")).shouldBe(enabled).sendKeys("jpa_admin");
$(By.id("loginForm:password")).shouldBe(enabled).sendKeys("jpa_admin");
$(By.id("loginForm:login")).shouldBe(enabled).click();
private static void startLoginAsAdmin(WebAppFixture fixture) {
fixture.login("jpa_admin", "jpa_admin");

open(EngineUrl.base() + "default-workflow/faces/profile.xhtml");
SelenideElement lang = $(By.name("profileForm:contentLanguage_editableInput")).shouldBe(enabled);
Expand Down
2 changes: 1 addition & 1 deletion persistence-utils-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>10.0.6</version>
<version>10.0.14</version>
<extensions>true</extensions>
<configuration>
<compilerOptions>
Expand Down
2 changes: 1 addition & 1 deletion persistence-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>10.0.6</version>
<version>10.0.14</version>
<extensions>true</extensions>
<configuration>
<compilerOptions>
Expand Down

0 comments on commit 920c69c

Please sign in to comment.