Skip to content

Commit

Permalink
move some ztl firefox testcases to zats
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsonChan committed Nov 29, 2024
1 parent 1a6ff5a commit 176263d
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* B36_2973306Test.java
Purpose:
Description:
History:
Fri Nov 29 19:19:41 CST 2024, Created by jamson
Copyright (C) 2024 Potix Corporation. All Rights Reserved.
*/
package org.zkoss.zktest.zats.test2;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Collections;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.openqa.selenium.chrome.ChromeOptions;

import org.zkoss.test.webdriver.ExternalZkXml;
import org.zkoss.test.webdriver.ForkJVMTestOnly;
import org.zkoss.test.webdriver.WebDriverTestCase;
import org.zkoss.test.webdriver.ztl.Widget;

@ForkJVMTestOnly
public class B36_2973306Test extends WebDriverTestCase {

protected boolean isHeadless() {
return false;
}

@RegisterExtension
public static final ExternalZkXml CONFIG = new ExternalZkXml("/test2/enable-tablet-ui-zk.xml");

@Override
protected ChromeOptions getWebDriverOptions() {
return super.getWebDriverOptions()
.setExperimentalOption("mobileEmulation", Collections.singletonMap("deviceName", "Nexus 7"));
}

@Test
public void test() {
connect();
Widget detail = jq("$detail").toWidget();
click(detail.$n("icon"));
waitResponse();
assertEquals(1, jq(detail.$n("fake")).find(">td").length());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* B50_ZK_580Test.java
Purpose:
Description:
History:
Fri Nov 29 16:29:59 CST 2024, Created by jamson
Copyright (C) 2024 Potix Corporation. All Rights Reserved.
*/
package org.zkoss.zktest.zats.test2;

import static org.junit.jupiter.api.Assertions.assertNotEquals;

import org.junit.jupiter.api.Test;

import org.zkoss.test.webdriver.FirefoxWebDriverTestCase;
import org.zkoss.test.webdriver.ztl.JQuery;

public class B50_ZK_580Test extends FirefoxWebDriverTestCase {

@Test
public void test() {
connect();
JQuery textbox = jq(".z-textbox");
clickAt(textbox, -40, 5);
waitResponse();
String originCursorPosition = zk(textbox).eval("getSelectionRange()[0]");

mouseOver(jq(".z-label"));
waitResponse();

clickAt(textbox, -10, 5);
waitResponse();
assertNotEquals(originCursorPosition, zk(textbox).eval("getSelectionRange()[0]"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* F70_ZK_2410Test.java
Purpose:
Description:
History:
Fri Nov 29 17:06:39 CST 2024, Created by jamson
Copyright (C) 2024 Potix Corporation. All Rights Reserved.
*/
package org.zkoss.zktest.zats.test2;

import static org.junit.jupiter.api.Assertions.assertEquals;

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

import org.zkoss.test.webdriver.FirefoxWebDriverTestCase;
import org.zkoss.test.webdriver.ztl.JQuery;

public class F70_ZK_2410Test extends FirefoxWebDriverTestCase {

@Test
public void test() {
connect();
JQuery input = jq(".z-paging-input");
click(input);
waitResponse();
sendKeys(jq("body"), Keys.TAB, Keys.ENTER);
waitResponse();
assertEquals(jq(".z-paging-input").eval("val()"), "2");
}
}

0 comments on commit 176263d

Please sign in to comment.