-
Notifications
You must be signed in to change notification settings - Fork 2
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 #10 from VicGrygorchyk/make_it_work_for_appium
Make it work for appium
- Loading branch information
Showing
8 changed files
with
115 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import pytest | ||
|
||
from selenium.webdriver.common.by import By | ||
|
||
from selen_kaa.element.se_web_element import SeWebElement | ||
from selen_kaa.element.se_elements_array import SeElementsArray | ||
|
||
|
||
@pytest.mark.parametrize("selector", ("div", ".class", "div[class='test']", | ||
"img[class^='irc_mut'][src^='http']")) | ||
def test_create_se_web_element_by_css(selector): | ||
element = SeWebElement(None, selector) | ||
assert element.locator_strategy == By.CSS_SELECTOR | ||
|
||
|
||
@pytest.mark.parametrize("selector", ( | ||
"//div", "./div/div/.class", | ||
"//div[@id='rso']//div[@class='test tttest']//a[contains(@href, '/imgres')]", | ||
"/html//div[contains(text(), 'The page')]", | ||
"/bookstore/book[price>35.00]/title" | ||
)) | ||
def test_create_se_web_element_by_xpath(selector): | ||
element = SeWebElement(None, selector) | ||
assert element.locator_strategy == By.XPATH | ||
|
||
|
||
@pytest.mark.parametrize("param", ( | ||
("class-name", By.CLASS_NAME), | ||
("img", By.TAG_NAME), | ||
('**/XCUIElementTypeImage[`label == "test"`]', 'MobileBy.IOS_CLASS_CHAIN') | ||
)) | ||
def test_create_se_web_element_by_custom_locator_strategy(param): | ||
selector, locator_strat = param | ||
element = SeWebElement(None, selector, locator_strategy=locator_strat) | ||
assert element.locator_strategy == locator_strat | ||
|
||
|
||
@pytest.mark.parametrize("selector", ("div", ".class", "div[class='test']", | ||
"img[class^='irc_mut'][src^='http']")) | ||
def test_create_web_element_arr_by_css(selector): | ||
elements = SeElementsArray(None, selector) | ||
assert elements.locator_strategy == By.CSS_SELECTOR | ||
|
||
|
||
@pytest.mark.parametrize("selector", ( | ||
"//div", "./div/div/.class", | ||
"//div[@id='rso']//div[@class='test tttest']//a[contains(@href, '/imgres')]", | ||
"/html//div[contains(text(), 'The page')]", | ||
"/bookstore/book[price>35.00]/title" | ||
)) | ||
def test_create_se_web_element_arr_by_xpath(selector): | ||
elements = SeElementsArray(None, selector) | ||
assert elements.locator_strategy == By.XPATH | ||
|
||
|
||
@pytest.mark.parametrize("param", ( | ||
("class-name", By.CLASS_NAME), | ||
("img", By.TAG_NAME), | ||
('**/XCUIElementTypeImage[`label == "test"`]', 'MobileBy.IOS_CLASS_CHAIN') | ||
)) | ||
def test_create_se_web_element_by_custom_locator_strategy(param): | ||
selector, locator_strat = param | ||
elements = SeElementsArray(None, selector, locator_strategy=locator_strat) | ||
assert elements.locator_strategy == locator_strat |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import pytest | ||
from selenium.webdriver.common.by import By | ||
|
||
|
||
from selen_kaa.utils import se_utils | ||
|
||
|
||
|