-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,761 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ chromedriver.log | |
phantomjsdriver.log | ||
.settings | ||
integration/ScreenshotTest/canTakeScreenshotOfElement/ | ||
classes |
77 changes: 77 additions & 0 deletions
77
src/test/java/com/codeborne/selenide/CollectionConditionTest.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,77 @@ | ||
package com.codeborne.selenide; | ||
|
||
import com.codeborne.selenide.collections.*; | ||
import org.junit.Test; | ||
|
||
import java.util.Arrays; | ||
|
||
import static org.hamcrest.CoreMatchers.instanceOf; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertThat; | ||
|
||
public class CollectionConditionTest { | ||
|
||
@Test | ||
public void testSizeIsEmptyListSize() { | ||
CollectionCondition collectionCondition = CollectionCondition.size(10); | ||
assertThat(collectionCondition, instanceOf(ListSize.class)); | ||
} | ||
|
||
@Test | ||
public void testSizeGreaterThan() { | ||
CollectionCondition collectionCondition = CollectionCondition.sizeGreaterThan(10); | ||
assertThat(collectionCondition, instanceOf(SizeGreaterThan.class)); | ||
} | ||
|
||
@Test | ||
public void testSizeGraterThenOrEqual() { | ||
CollectionCondition collectionCondition = CollectionCondition.sizeGreaterThanOrEqual(10); | ||
assertThat(collectionCondition, instanceOf(SizeGreaterThanOrEqual.class)); | ||
} | ||
|
||
@Test | ||
public void testSizeLessThan() { | ||
CollectionCondition collectionCondition = CollectionCondition.sizeLessThan(10); | ||
assertThat(collectionCondition, instanceOf(SizeLessThan.class)); | ||
} | ||
|
||
@Test | ||
public void testSizeLessThanOrEqual() { | ||
CollectionCondition collectionCondition = CollectionCondition.sizeLessThanOrEqual(10); | ||
assertThat(collectionCondition, instanceOf(SizeLessThanOrEqual.class)); | ||
} | ||
|
||
@Test | ||
public void testSizeNotEqual() { | ||
CollectionCondition collectionCondition = CollectionCondition.sizeNotEqual(10); | ||
assertThat(collectionCondition, instanceOf(SizeNotEqual.class)); | ||
} | ||
|
||
@Test | ||
public void testTextsWithObjectsList() { | ||
CollectionCondition collectionCondition = CollectionCondition.texts("One", "Two", "Three"); | ||
assertThat(collectionCondition, instanceOf(Texts.class)); | ||
assertEquals("Texts content", "Texts [One, Two, Three]", collectionCondition.toString()); | ||
} | ||
|
||
@Test | ||
public void testTextsWithListOfStrings() { | ||
CollectionCondition collectionCondition = CollectionCondition.texts(Arrays.asList("One", "Two", "Three")); | ||
assertThat(collectionCondition, instanceOf(Texts.class)); | ||
assertEquals("Texts content", "Texts [One, Two, Three]", collectionCondition.toString()); | ||
} | ||
|
||
@Test | ||
public void testExactTextsWithObjectsList() { | ||
CollectionCondition collectionCondition = CollectionCondition.exactTexts("One", "Two", "Three"); | ||
assertThat(collectionCondition, instanceOf(ExactTexts.class)); | ||
assertEquals("Exact texts content", "Exact texts [One, Two, Three]", collectionCondition.toString()); | ||
} | ||
|
||
@Test | ||
public void testExactTextsWithListOfStrings() { | ||
CollectionCondition collectionCondition = CollectionCondition.exactTexts(Arrays.asList("One", "Two", "Three")); | ||
assertThat(collectionCondition, instanceOf(ExactTexts.class)); | ||
assertEquals("Exact texts content", "Exact texts [One, Two, Three]", collectionCondition.toString()); | ||
} | ||
} |
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
Oops, something went wrong.