This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from slu-it/select-performance
Performance enhancement for the Select PageObject
- Loading branch information
Showing
3 changed files
with
69 additions
and
16 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
40 changes: 40 additions & 0 deletions
40
...er-core/src/main/java/info/novatec/testit/webtester/pageobjects/utils/EnhancedSelect.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,40 @@ | ||
package info.novatec.testit.webtester.pageobjects.utils; | ||
|
||
import java.util.List; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.ui.Select; | ||
|
||
|
||
/** | ||
* This implementation of Selenium's {@link Select} helper class fixes some issues with the original implementation. | ||
* <p> | ||
* <b>Fixed Issues:</b> | ||
* <ul> | ||
* <li>{@link #getFirstSelectedOption()} has very bad performance in case of great number of options</li> | ||
* <li>{@link #getAllSelectedOptions()} has very bad performance in case of great number of options</li> | ||
* </ul> | ||
* | ||
* @since 1.2 | ||
*/ | ||
public class EnhancedSelect extends Select { | ||
|
||
private final WebElement element; | ||
|
||
public EnhancedSelect(WebElement element) { | ||
super(element); | ||
this.element = element; | ||
} | ||
|
||
@Override | ||
public WebElement getFirstSelectedOption() { | ||
return element.findElement(By.cssSelector("option:checked")); | ||
} | ||
|
||
@Override | ||
public List<WebElement> getAllSelectedOptions() { | ||
return element.findElements(By.cssSelector("option:checked")); | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
webtester-support-marionette/src/license/THIRD-PARTY.properties
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,15 @@ | ||
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo | ||
#------------------------------------------------------------------------------- | ||
# Already used licenses in project : | ||
# - ASL, version 2 | ||
# - Apache License, Version 2.0 | ||
# - LGPL, version 2.1 | ||
# - MIT License | ||
# - The Apache License, Version 2.0 | ||
# - The Apache Software License, Version 2.0 | ||
#------------------------------------------------------------------------------- | ||
# Please fill the missing licenses for dependencies : | ||
# | ||
# | ||
#Fri Jul 29 18:18:37 CEST 2016 | ||
cglib--cglib-nodep--2.1_3=The Apache Software License, Version 2.0 |