From e9da369ca70a339a60bfa2ea4b0a9ef58ca42881 Mon Sep 17 00:00:00 2001 From: Trey Chadick Date: Fri, 18 Oct 2024 15:48:18 -0700 Subject: [PATCH] Update test file templates (#903) --- .idea/fileTemplates/WebDriverTestClass.java | 4 ++-- .idea/fileTemplates/WebDriverTestComponent.java | 6 +++--- .idea/fileTemplates/WebDriverTestPage.java | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.idea/fileTemplates/WebDriverTestClass.java b/.idea/fileTemplates/WebDriverTestClass.java index 200afd556a..df87d07900 100644 --- a/.idea/fileTemplates/WebDriverTestClass.java +++ b/.idea/fileTemplates/WebDriverTestClass.java @@ -14,7 +14,7 @@ @Category({}) public class ${NAME} extends BaseWebDriverTest { - private static final String USER = "template_user@${NAME}.test"; + private static final String USER = "template_user@${NAME.toLowerCase()}.test"; @Override protected void doCleanup(boolean afterTest) @@ -46,7 +46,7 @@ public void preTest() @Test public void testSomething() { - assertTrue("Test something", true); + assertTrue("Failing stub test", false); } @Override diff --git a/.idea/fileTemplates/WebDriverTestComponent.java b/.idea/fileTemplates/WebDriverTestComponent.java index b0171db46e..29ed04c84b 100644 --- a/.idea/fileTemplates/WebDriverTestComponent.java +++ b/.idea/fileTemplates/WebDriverTestComponent.java @@ -43,12 +43,12 @@ public WebDriver getDriver() return this; } - public LabKeyPage clickButton() + public LabKeyPage clickButton() { getWrapper().clickAndWait(elementCache().button); // TODO: Methods that navigate should return an appropriate page object - return new LabKeyPage(getDriver()); + return new LabKeyPage<>(getDriver()); } @Override @@ -62,7 +62,7 @@ protected ElementCache newElementCache() * ElementCache should be responsible for finding and storing all elements and * sub-components that the component contains */ - protected class ElementCache extends Component.ElementCache + protected class ElementCache extends Component.ElementCache { // TODO: Add elements that are in the component final Input input = Input(Locator.css("input"), getDriver()).findWhenNeeded(this); diff --git a/.idea/fileTemplates/WebDriverTestPage.java b/.idea/fileTemplates/WebDriverTestPage.java index 84d77629ea..95434af013 100644 --- a/.idea/fileTemplates/WebDriverTestPage.java +++ b/.idea/fileTemplates/WebDriverTestPage.java @@ -27,12 +27,12 @@ public class ${NAME} extends LabKeyPage<${NAME}.ElementCache> } // TODO: Add methods for other actions on this page - public LabKeyPage clickButton() + public LabKeyPage clickButton() { clickAndWait(elementCache().example); // TODO: Methods that navigate should return an appropriate page object - return new LabKeyPage(getDriver()); + return new LabKeyPage<>(getDriver()); } @Override @@ -41,9 +41,9 @@ protected ElementCache newElementCache() return new ElementCache(); } - protected class ElementCache extends LabKeyPage.ElementCache + protected class ElementCache extends LabKeyPage.ElementCache { // TODO: Add other elements that are on the page - WebElement example = Locator.css("button").findWhenNeeded(this); + final WebElement example = Locator.css("button").findWhenNeeded(this); } }