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 fbc2c1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions doc-factory-demos-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,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>[6.8.0,]</version><!-- keep compatible with web-tester -->
<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

0 comments on commit fbc2c1d

Please sign in to comment.