Skip to content

Commit

Permalink
fix: dev-pipeline failing due to newer selenide version
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-rew committed Dec 4, 2023
1 parent b737c94 commit 901ca4d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
uses: './.github/workflows/ci.yml'
secrets: inherit
with:
mvnArgs: '"-Divy.engine.download.url=https://dev.axonivy.com/permalink/dev/axonivy-engine.zip" "-Divy.engine.version=11.3.0" "-Dproject-build-plugin-version=11.3.0-SNAPSHOT" "-Dweb-tester.version=11.3.0-SNAPSHOT" -Dmaven.deploy.skip=true'
mvnArgs: '"-Divy.engine.download.url=https://dev.axonivy.com/permalink/dev/axonivy-engine.zip" "-Divy.engine.version=11.3.0" "-Dproject-build-plugin-version=11.3.0-SNAPSHOT" "-Dweb-tester.version=11.3.0-SNAPSHOT" "-Dselenide-version=7.0.2" -Dmaven.deploy.skip=true'

9 changes: 5 additions & 4 deletions doc-factory-demos-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<properties>
<project-build-plugin-version>10.0.14</project-build-plugin-version>
<web-tester.version>10.0.14</web-tester.version>
<selenide-version>6.8.1</selenide-version>
</properties>

<dependencies>
Expand All @@ -22,12 +23,12 @@
<groupId>com.axonivy.ivy.webtest</groupId>
<artifactId>web-tester</artifactId>
<version>${web-tester.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide-proxy</artifactId>
<version>6.9.0</version>
<version>${selenide-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.axon.docfactory.demos;

import static com.codeborne.selenide.Condition.exactText;
import static com.codeborne.selenide.Condition.visible;
import static com.codeborne.selenide.Selectors.withText;
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.open;
import static org.assertj.core.api.Assertions.assertThat;

import java.io.FileNotFoundException;
import java.nio.file.Path;

import org.junit.jupiter.api.BeforeAll;
Expand All @@ -21,11 +18,19 @@
import com.codeborne.selenide.Configuration;
import com.codeborne.selenide.FileDownloadMode;
import com.codeborne.selenide.Selenide;
import com.codeborne.selenide.WebElementCondition;
import com.codeborne.selenide.conditions.ExactText;
import com.codeborne.selenide.conditions.Visible;

@IvyWebTest
class WebTestApiExamplesIT {
private final String DOC_DEMOS_BASE = "/DocFactoryDemos/16B45CBCE0D2056C/";

static final WebElementCondition visible = new Visible();
static WebElementCondition exactText(String text) {
return new ExactText(text);
}

@BeforeAll
static void setup(@TempDir Path tempDir) {
Configuration.timeout = 10000;
Expand Down Expand Up @@ -60,7 +65,7 @@ void docWithNestedTablesHTML() throws Exception {
}

@Test
void zipMultipleDocuments() throws FileNotFoundException {
void zipMultipleDocuments() throws Exception {
open(EngineUrl.createProcessUrl("/DocFactoryDemos/16CD7829EF6B489B/start2.ivp"));
var doc = Selenide.$$("button").find(exactText("Create Multiple Formats")).shouldBe(visible).download();
assertThat(doc).hasName("Documents.zip");
Expand All @@ -86,7 +91,7 @@ void ivyDocApi(WebAppFixture fixture) {
$("iframe").shouldBe(visible);
}

private void assertDownload(String process, String expectedFileName) throws FileNotFoundException {
private void assertDownload(String process, String expectedFileName) throws Exception {
open(EngineUrl.createProcessUrl(DOC_DEMOS_BASE + process));
var doc = $("#docLink").shouldBe(visible).download();
assertThat(doc).hasName(expectedFileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import static com.codeborne.selenide.Selenide.open;
import static org.assertj.core.api.Assertions.assertThat;

import java.io.FileNotFoundException;
import java.nio.file.Path;
import java.time.Duration;

Expand Down Expand Up @@ -62,11 +61,11 @@ void docWithNestedObject() throws Exception {
assertDownload("start6.ivp", "DocWithNestedObject.pdf");
}

private void assertDownload(String process, String expectedFileName) throws FileNotFoundException {
private void assertDownload(String process, String expectedFileName) throws Exception {
open(EngineUrl.createProcessUrl(DOC_DEMOS_BASE + process));
var doc = $("#docLink").shouldBe(visible).download(DownloadOptions.using(FileDownloadMode.PROXY)
.withTimeout(Duration.ofSeconds(10))
.withFilter(FileFilters.withName(expectedFileName)));
.withFilter(FileFilters.withName(expectedFileName)));

assertThat(doc).hasName(expectedFileName);
assertThat(doc.length() / 1024).isGreaterThan(15);
Expand Down

0 comments on commit 901ca4d

Please sign in to comment.