-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # pom.xml Prepared release and bumped version to 2.1.0
- Loading branch information
Showing
13 changed files
with
230 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ava/com/xceptance/neodymium/testclasses/allure/AllureSelenideListenerIsActiveForJava.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.xceptance.neodymium.testclasses.allure; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import com.codeborne.selenide.logevents.SelenideLogger; | ||
import com.xceptance.neodymium.NeodymiumRunner; | ||
import com.xceptance.neodymium.module.statement.browser.multibrowser.Browser; | ||
|
||
@RunWith(NeodymiumRunner.class) | ||
@Browser("Chrome_headless") | ||
public class AllureSelenideListenerIsActiveForJava | ||
{ | ||
@Test | ||
public void testWaitingAnimationSelectorUnconfigured() | ||
{ | ||
Assert.assertTrue(" AllureSelenide listener is not attached", SelenideLogger.hasListener(NeodymiumRunner.LISTENER_NAME)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ptance/neodymium/testclasses/cucumber/CucumberValidateAllureSelenideListenerIsActive.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.xceptance.neodymium.testclasses.cucumber; | ||
|
||
import org.junit.runner.RunWith; | ||
|
||
import com.xceptance.neodymium.NeodymiumCucumberRunner; | ||
|
||
import cucumber.api.CucumberOptions; | ||
|
||
@RunWith(NeodymiumCucumberRunner.class) | ||
@CucumberOptions(features = "src/test/resources/com/xceptance/neodymium/testclasses/cucumber/CucumberValidateAllureSelenideListenerIsActive.feature", glue = "com/xceptance/neodymium/testclasses/cucumber", plugin = "null_summary") | ||
public class CucumberValidateAllureSelenideListenerIsActive | ||
{ | ||
} |
25 changes: 25 additions & 0 deletions
25
src/test/java/com/xceptance/neodymium/tests/AllureSelenideListenerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.xceptance.neodymium.tests; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.JUnitCore; | ||
import org.junit.runner.Result; | ||
|
||
import com.xceptance.neodymium.testclasses.allure.AllureSelenideListenerIsActiveForJava; | ||
import com.xceptance.neodymium.testclasses.cucumber.CucumberValidateAllureSelenideListenerIsActive; | ||
|
||
public class AllureSelenideListenerTest extends NeodymiumTest | ||
{ | ||
@Test | ||
public void testAllureSelenideListenerIsActiveForCucumber() | ||
{ | ||
Result result = JUnitCore.runClasses(CucumberValidateAllureSelenideListenerIsActive.class); | ||
checkPass(result, 1, 0, 0); | ||
} | ||
|
||
@Test | ||
public void testAllureSelenideListenerIsActiveForJava() | ||
{ | ||
Result result = JUnitCore.runClasses(AllureSelenideListenerIsActiveForJava.class); | ||
checkPass(result, 1, 0, 0); | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
src/test/java/com/xceptance/neodymium/util/SelenideAddonsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.xceptance.neodymium.util; | ||
|
||
import static com.codeborne.selenide.Selenide.$; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import com.codeborne.selenide.Selenide; | ||
import com.codeborne.selenide.ex.ElementShould; | ||
import com.codeborne.selenide.ex.UIAssertionError; | ||
import com.xceptance.neodymium.NeodymiumRunner; | ||
import com.xceptance.neodymium.module.statement.browser.multibrowser.Browser; | ||
|
||
@RunWith(NeodymiumRunner.class) | ||
@Browser("Chrome_headless") | ||
public class SelenideAddonsTest | ||
{ | ||
@Test | ||
public void testMatchesValueCondition() | ||
{ | ||
Selenide.open("https://blog.xceptance.com/"); | ||
$("#masthead .search-toggle").click(); | ||
$("#search-container .search-field").val("searchphrase").submit(); | ||
|
||
$("#content .search-field").should(SelenideAddons.matchesValue("earchphras")); | ||
} | ||
|
||
@Test | ||
public void testMatchValueCondition() | ||
{ | ||
Selenide.open("https://blog.xceptance.com/"); | ||
$("#masthead .search-toggle").click(); | ||
$("#search-container .search-field").val("searchphrase").submit(); | ||
|
||
$("#content .search-field").should(SelenideAddons.matchValue("^s.a.c.p.r.s.$")); | ||
$("#content .search-field").should(SelenideAddons.matchValue("\\D+")); | ||
} | ||
|
||
@Test(expected = ElementShould.class) | ||
public void testMatchValueConditionError() | ||
{ | ||
Selenide.open("https://blog.xceptance.com/"); | ||
$("#masthead .search-toggle").click(); | ||
$("#search-container .search-field").val("searchphrase").submit(); | ||
|
||
$("#content .search-field").should(SelenideAddons.matchValue("\\d+")); | ||
} | ||
|
||
@Test() | ||
public void testWrapAssertion() | ||
{ | ||
Selenide.open("https://blog.xceptance.com/"); | ||
SelenideAddons.wrapAssertionError(() -> { | ||
Assert.assertEquals("Passionate Testing | Xceptance Blog", Selenide.title()); | ||
}); | ||
} | ||
|
||
@Test(expected = UIAssertionError.class) | ||
public void testWrapAssertionError() | ||
{ | ||
Selenide.open("https://blog.xceptance.com/"); | ||
SelenideAddons.wrapAssertionError(() -> { | ||
Assert.assertEquals("MyPageTitle", Selenide.title()); | ||
}); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...nce/neodymium/testclasses/cucumber/CucumberValidateAllureSelenideListenerIsActive.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@SetUpWithBrowserTag | ||
Feature: Set browser via tag | ||
|
||
@Chrome_headless | ||
Scenario: Set browsers | ||
Given the browser "Chrome_headless" is setup | ||
Then validate the AllureSelenide listener is active | ||
|