Skip to content

Commit

Permalink
Merge pull request #233 from axonivy-market/maintain
Browse files Browse the repository at this point in the history
Maintain
  • Loading branch information
ivy-rew authored Nov 1, 2023
2 parents 9403a72 + a2431ce commit 047051c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,30 @@
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.open;

import java.time.Duration;

import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;

import com.axonivy.ivy.webtest.IvyWebTest;
import com.axonivy.ivy.webtest.engine.EngineUrl;

@IvyWebTest(headless = true)
public class WebTestAsposeBarcodeDemo{
public class WebTestAsposeBarcodeDemoIT{

private static final String BARCODE_STRING = "form:str";
private static final String PROCEED_BUTTON = "form:proceed";
private static final String BARCODE_IMAGE = "code_128";

@Test
public void createBarcodePage(){

open(EngineUrl.createProcessUrl("AsposeBarcodeDemo/16CD7829EF6B489B/start.ivp"));

open(EngineUrl.createProcessUrl("AsposeBarcodeDemo/16CD7829EF6B489B/start.ivp"));

$(By.id(BARCODE_STRING)).shouldBe(empty);
$(By.id(BARCODE_STRING)).sendKeys(String.valueOf("Hello Axon Ivy"));
$(By.id(PROCEED_BUTTON)).shouldBe(visible).click();
$(By.id(BARCODE_IMAGE)).shouldBe(visible).isImage();

$(By.id(BARCODE_IMAGE)).shouldBe(visible, Duration.ofSeconds(30)).isImage();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
import java.time.Duration;

import org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -19,23 +20,22 @@
import com.codeborne.selenide.Selenide;

@IvyWebTest
public class WebTestAsposeEmailDemo
{
public class WebTestAsposeEmailDemoIT {

@BeforeAll
public static void setUp()
{
public static void setUp() {
Selenide.closeWebDriver();
Configuration.proxyEnabled = true;
Configuration.fileDownload = FileDownloadMode.PROXY;
Selenide.open();
}

@Test
public void testMsgEmail() throws Exception
{
open(EngineUrl.createProcessUrl("AsposeEmailDemo/1712BF5507F25F15/start.ivp"));
File msg = $(By.id("form:createBtn")).shouldBe(visible).download();
public void testMsgEmail() throws Exception {
open(EngineUrl.createProcessUrl("AsposeEmailDemo/1712BF5507F25F15/start.ivp"));
$(By.id("form:customer")).shouldBe(visible);
var creator = $(By.id("form:createBtn")).shouldBe(visible, Duration.ofSeconds(30));
File msg = creator.download(Duration.ofSeconds(30).toMillis());

Awaitility.await().untilAsserted(() -> {
assertThat(msg).exists();
Expand Down

0 comments on commit 047051c

Please sign in to comment.