Package co.nz.getskills.auto.appsteps
Class CommonSteps
- java.lang.Object
-
- co.nz.getskills.auto.Base.TestDriver
-
- co.nz.getskills.auto.appsteps.CommonSteps
-
public class CommonSteps extends TestDriver
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Propertiesproperties-
Fields inherited from class co.nz.getskills.auto.Base.TestDriver
options, prop, service, webDriver, webDriverManager
-
-
Constructor Summary
Constructors Constructor Description CommonSteps(TestContext testContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptWebAlert()voiddismissWebAlert()voiddoubleClick(java.lang.String locatorPath)voidencryptPasssword(java.lang.String password)voidget_attribute_data(java.lang.String attribute, java.lang.String locatorPath)java.lang.StringgetLastLocator(java.lang.String locatorPath)voidgetPageSource()voidi_check_count_of_elements(java.lang.String locatorPath, int count)voidi_check_count_of_elements_time(java.lang.String locatorPath, int count)voidi_check_element_locator_enabled(java.lang.String locatorPath)voidi_check_item_has_price(java.lang.String itemName, java.lang.String price)voidi_clear_field_locator(java.lang.String locatorPath)voidi_click_button_next_to_text(java.lang.String text)voidi_click_element(java.lang.String locatorPath)Clicks element of specified locator.voidi_click_element_captcha(java.lang.String locatorPath)voidi_click_element_if_two_elements_equal(java.lang.String locatorPath1, java.lang.String locatorPath2, java.lang.String locatorPath3)voidi_click_element_if_visible(java.lang.String locatorPath)voidi_click_element_locator(java.lang.String locatorPath)voidi_click_element_on_seeingElement(java.lang.String conditionLocatorPath, java.lang.String locatorPath)voidi_click_element_xpath(java.lang.String xpath)voidi_click_Tab(java.lang.String tabName)voidi_click_Text(java.lang.String text)voidi_click_Text_On_Sequence(java.lang.String text, int sequenceNumber)voidi_click_Text_WithId(java.lang.String text, java.lang.String id)voidi_click_Text_WithXpath(java.lang.String text, java.lang.String xpath)voidi_drag_drop(java.lang.String locatorPathFrom, java.lang.String locatorPathTo)voidi_fill_Field_With_encryptedPassword(java.lang.String locatorPath, java.lang.String value)voidi_fill_Field_With_Stored_Data(java.lang.String locatorPath, java.lang.String dataPath)voidi_fill_Field_WithData(java.lang.String locatorPath, java.lang.String dataPath)voidi_fill_Field_WithIdandValue(java.lang.String text, java.lang.String id, java.lang.String value)voidi_fill_Field_WithValue(java.lang.String locatorPath, java.lang.String value)voidi_fill_field_withValue_on_seeingElement(java.lang.String conditionLocatorPath, java.lang.String locatorPath, java.lang.String value)voidi_fill_Field_WithXpathandValue(java.lang.String text, java.lang.String xpath, java.lang.String value)voidi_fill_id_with_value(java.lang.String id, java.lang.String value)voidi_fill_input_locator_data(java.lang.String locatorPath, java.lang.String dataPath)voidi_fill_via_random_value_Mobile(java.lang.String locatorPath, java.lang.String alias, java.lang.String emailDomain)voidi_fillfield_inputlabel_value(java.lang.String fieldLable, java.lang.String value)voidi_go_to_url(java.lang.String url)voidi_hover_mouse_on_element_locator(java.lang.String locatorPath)voidi_open_app(java.lang.String appName)voidi_open_page(java.lang.String pageName)voidi_select_Date_Value(java.lang.String dateValue)voidi_select_dropdown_value(java.lang.String selectId, java.lang.String dropDownValue)voidi_select_dropdown_value_with_index(java.lang.String selectId, java.lang.String index)voidi_select_dropdown_value_withXpath(java.lang.String selectXpath, java.lang.String dropDownValue)voidi_set_length(java.lang.String text)voidI_set_property(java.lang.String property, java.lang.String value)voidi_tap_element_locator(java.lang.String locatorPath)voidi_upload_Field_WithLocatorPathAndFilepath(java.lang.String text, java.lang.String locatorPath, java.lang.String filePath)voidi_upload_Field_WithXpathAndFilepath(java.lang.String text, java.lang.String xpath, java.lang.String filePath)voidi_verify_web_text_contains_via_data_json(java.lang.String dataPath, java.lang.String locatorPath)voidi_wait_element_clikable(java.lang.String locatorPath)voidi_wait_element_not_visible(java.lang.String locatorPath)voidi_wait_element_not_visible_xpath(java.lang.String xpath)voidi_wait_element_visible(java.lang.String locatorPath)voidi_wait_element_visible_xpath(java.lang.String xpath)voidi_wait_loading_locator(java.lang.String locatorPath)voidif_alert_visible_accept_alert()voidpressEnterKey(java.lang.String locatorPath)voidpressEscapeKey(java.lang.String locatorPath)voidpressTabKey(java.lang.String locatorPath)java.lang.StringPrintStackTrace(java.lang.String error)voidscrollTo(java.lang.String locatorPath)voidscrollToBottom(java.lang.String locatorPath)voidscrollToTop(java.lang.String locatorPath)voidsend_keys_locator_path_with_input(java.lang.String locatorPath, java.lang.String input)voidsend_keys_with_locator_path_with_data_path(java.lang.String locatorPath, java.lang.String dataPath)voidsend_keys_xpath(java.lang.String xpath, java.lang.String input)voidswitch_default()voidswitchOutOfIframe()voidswitchToIframe(java.lang.String iframe)voidswitchToIframeWithLocator(java.lang.String locatorPath)voidswitchToParentIframe()voidswitchToParentWindow()voidswitchToTab()voidswitchToWindow(java.lang.String windowName)voidswitchToWindowWithIndex(java.lang.String index)voidtakeScreenshot()voidtest()voidwait(int seconds)-
Methods inherited from class co.nz.getskills.auto.Base.TestDriver
setUpWebDriver, setUpWiniumDriver
-
-
-
-
Constructor Detail
-
CommonSteps
public CommonSteps(TestContext testContext)
-
-
Method Detail
-
i_open_page
@When("^I open (.+) page$") public void i_open_page(java.lang.String pageName) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_Tab
@When("^I click tab (.+)$") public void i_click_Tab(java.lang.String tabName) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_Text
@When("^I click text (.+)$") public void i_click_Text(java.lang.String text) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_Text_On_Sequence
@When("^I click webelement text (.+) on sequence (\\d+)$") public void i_click_Text_On_Sequence(java.lang.String text, int sequenceNumber) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_select_Date_Value
@When("^I select date value (.+)$") public void i_select_Date_Value(java.lang.String dateValue) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_open_app
@When("^I open app (.+)$") public void i_open_app(java.lang.String appName) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_button_next_to_text
@When("^I click Add button next to text (.+)$") public void i_click_button_next_to_text(java.lang.String text) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_Text_WithId
@When("^I click button (.+) with id (.+)$") public void i_click_Text_WithId(java.lang.String text, java.lang.String id) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_Text_WithXpath
@When("^I click button (.+) with xpath (.+)$") public void i_click_Text_WithXpath(java.lang.String text, java.lang.String xpath) throws java.lang.Exception- Throws:
java.lang.Exception
-
send_keys_xpath
@When("^I fill input field element with xpath (.+) using send keys with input (.+)$") public void send_keys_xpath(java.lang.String xpath, java.lang.String input) throws java.lang.Exception- Throws:
java.lang.Exception
-
send_keys_with_locator_path_with_data_path
@When("^I fill input field element with locator (.+) using send keys with data (.+)$") public void send_keys_with_locator_path_with_data_path(java.lang.String locatorPath, java.lang.String dataPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
send_keys_locator_path_with_input
@When("^I fill input field element with locator (.+) using send keys with input (.+)$") public void send_keys_locator_path_with_input(java.lang.String locatorPath, java.lang.String input) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_wait_element_visible
@When("^I wait for element (.+) to be visible$") public void i_wait_element_visible(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_wait_element_clikable
@When("^I wait for element (.+) to be clickable$") public void i_wait_element_clikable(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_wait_element_visible_xpath
@When("^I wait for xpath (.+) to be visible$") public void i_wait_element_visible_xpath(java.lang.String xpath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_wait_element_not_visible
@When("^I wait for element (.+) to not be visible$") public void i_wait_element_not_visible(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_wait_element_not_visible_xpath
@When("^I wait for element with xpath (.+) to not be visible$") public void i_wait_element_not_visible_xpath(java.lang.String xpath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_wait_loading_locator
@When("^If I see loading element with locator (.+) I wait until complete$") public void i_wait_loading_locator(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_drag_drop
@When("^I drag element (.+) and drop to element (.+)$") public void i_drag_drop(java.lang.String locatorPathFrom, java.lang.String locatorPathTo) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_Field_WithXpathandValue
@When("^I fill field (.+) with xpath (.+) with value (.+)$") public void i_fill_Field_WithXpathandValue(java.lang.String text, java.lang.String xpath, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_upload_Field_WithXpathAndFilepath
@When("^I upload field (.+) with xpath (.+) with filePath (.+)$") public void i_upload_Field_WithXpathAndFilepath(java.lang.String text, java.lang.String xpath, java.lang.String filePath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_upload_Field_WithLocatorPathAndFilepath
@When("^I upload field (.+) with locator path (.+) with filePath (.+)$") public void i_upload_Field_WithLocatorPathAndFilepath(java.lang.String text, java.lang.String locatorPath, java.lang.String filePath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_Field_WithValue
@When("^I fill input (.+) with value (.+)$") public void i_fill_Field_WithValue(java.lang.String locatorPath, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_Field_WithData
@When("^I fill input (.+) with data (.+)$") public void i_fill_Field_WithData(java.lang.String locatorPath, java.lang.String dataPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_Field_With_Stored_Data
@When("^I fill input (.+) with stored data (.+)$") public void i_fill_Field_With_Stored_Data(java.lang.String locatorPath, java.lang.String dataPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_verify_web_text_contains_via_data_json
@When("^I verify data (.+) is present in element (.+)$") public void i_verify_web_text_contains_via_data_json(java.lang.String dataPath, java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
getLastLocator
public java.lang.String getLastLocator(java.lang.String locatorPath)
-
i_clear_field_locator
@When("^I clear input field element with locator (.+)$") public void i_clear_field_locator(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_field_withValue_on_seeingElement
@When("^If I see element (.+) then I fill input (.+) with value (.+)$") public void i_fill_field_withValue_on_seeingElement(java.lang.String conditionLocatorPath, java.lang.String locatorPath, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_element_on_seeingElement
@When("^If I see element (.+) then I click element (.+)$") public void i_click_element_on_seeingElement(java.lang.String conditionLocatorPath, java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_Field_With_encryptedPassword
@When("^I fill input (.+) with encrypted password (.+)$") public void i_fill_Field_With_encryptedPassword(java.lang.String locatorPath, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_Field_WithIdandValue
@When("^I fill field (.+) with id (.+) with value (.+)$") public void i_fill_Field_WithIdandValue(java.lang.String text, java.lang.String id, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_check_item_has_price
@When("^I check item (.+) has price (.+)$") public void i_check_item_has_price(java.lang.String itemName, java.lang.String price) throws java.lang.Exception- Throws:
java.lang.Exception
-
switchToIframeWithLocator
@Then("^I switch to iframe with locator (.+)$") public void switchToIframeWithLocator(java.lang.String locatorPath) throws java.io.IOException- Throws:
java.io.IOException
-
i_click_element_captcha
@When("^I click captcha element (.+)$") public void i_click_element_captcha(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
switch_default
@When("^I switch to default content$") public void switch_default() throws java.lang.Exception- Throws:
java.lang.Exception
-
i_set_length
@When("^I set length of random string (.+)$") public void i_set_length(java.lang.String text) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_select_dropdown_value
@When("^I select the dropdown with id (.+) and select value (.+)$") public void i_select_dropdown_value(java.lang.String selectId, java.lang.String dropDownValue) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_select_dropdown_value_withXpath
@When("^I select the dropdown element (.+) and select value (.+)$") public void i_select_dropdown_value_withXpath(java.lang.String selectXpath, java.lang.String dropDownValue) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_select_dropdown_value_with_index
@When("^I select the dropdown with id (.+) and index (.+)$") public void i_select_dropdown_value_with_index(java.lang.String selectId, java.lang.String index) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fillfield_inputlabel_value
@When("^I fill inputelement with label (.+) with value (.+)$") public void i_fillfield_inputlabel_value(java.lang.String fieldLable, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
switchToIframe
@Then("^I switch to iframe with id or name (.+)$") public void switchToIframe(java.lang.String iframe)
-
switchToParentIframe
@Then("^I switch to parent iframe of multiple iframes$") public void switchToParentIframe()
-
switchToWindow
@Then("^I switch to window with id or name or title (.+)$") public void switchToWindow(java.lang.String windowName)
-
switchToWindowWithIndex
@Then("^I switch to window with index (.+)$") public void switchToWindowWithIndex(java.lang.String index)
-
switchToTab
@Then("^I switch to tab$") public void switchToTab()
-
switchToParentWindow
@Then("^I switch to parent window$") public void switchToParentWindow() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
switchOutOfIframe
@Then("^I switch out of iframe$") public void switchOutOfIframe()
-
acceptWebAlert
@Then("^I accept web alert$") public void acceptWebAlert()
-
getPageSource
@When("I get page source") public void getPageSource()
-
dismissWebAlert
@Then("^I dismiss web alert$") public void dismissWebAlert()
-
pressEnterKey
@Then("^I press enter key on element (.+)$") public void pressEnterKey(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
pressTabKey
@Then("^I press tab key on element (.+)$") public void pressTabKey(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
pressEscapeKey
@Then("^I press escape key on element (.+)$") public void pressEscapeKey(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
encryptPasssword
@Then("^I encrypt my plain text password (.+)$") public void encryptPasssword(java.lang.String password)
-
doubleClick
@Then("^I double click on an element (.+)$") public void doubleClick(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
scrollTo
@Then("^I scroll to element (.+)$") public void scrollTo(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
scrollToTop
@Then("^I scroll to top area of element (.+)$") public void scrollToTop(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
scrollToBottom
@Then("^I scroll to bottom area of element (.+)$") public void scrollToBottom(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
takeScreenshot
@Then("Screenshot - I take screenshot of current Page") public void takeScreenshot() throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_element_locator
@When("^I click element with locator (.+)$") public void i_click_element_locator(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_tap_element_locator
@When("^AndroidBrowser - I click element with locator (.+)$") public void i_tap_element_locator(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_hover_mouse_on_element_locator
@When("^I hover mouse on element with locator (.+)$") public void i_hover_mouse_on_element_locator(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_input_locator_data
@When("^I fill input with locator (.+) with data (.+)$") public void i_fill_input_locator_data(java.lang.String locatorPath, java.lang.String dataPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
get_attribute_data
@When("^I get value of attribute (.+) from element (.+)$") public void get_attribute_data(java.lang.String attribute, java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_id_with_value
@When("^JS-I fill id (.+) with value (.+)$") public void i_fill_id_with_value(java.lang.String id, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_element
@When("^I click element (.+)$") public void i_click_element(java.lang.String locatorPath) throws java.lang.ExceptionClicks element of specified locator.- Parameters:
locatorPath-- Throws:
java.lang.Exception
-
i_check_element_locator_enabled
@When("^I check element with locator (.+) is enabled$") public void i_check_element_locator_enabled(java.lang.String locatorPath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_element_xpath
@When("^I check element with xpath (.+)$") public void i_click_element_xpath(java.lang.String xpath) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_check_count_of_elements
@When("^I check count of elements (.+) is (.+)$") public void i_check_count_of_elements(java.lang.String locatorPath, int count) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_check_count_of_elements_time
@When("^For a duration - I check total count of elements (.+) test is (.+)$") public void i_check_count_of_elements_time(java.lang.String locatorPath, int count) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_click_element_if_two_elements_equal
@When("^If element with locator (.+) is the same as element with locator (.+) then I click element with locator (.+)$") public void i_click_element_if_two_elements_equal(java.lang.String locatorPath1, java.lang.String locatorPath2, java.lang.String locatorPath3) throws java.lang.Exception- Throws:
java.lang.Exception
-
i_fill_via_random_value_Mobile
@When("^I fill element (.+) with random email alias (.+) with domain (.+)") public void i_fill_via_random_value_Mobile(java.lang.String locatorPath, java.lang.String alias, java.lang.String emailDomain) throws java.lang.Exception- Throws:
java.lang.Exception
-
PrintStackTrace
public java.lang.String PrintStackTrace(java.lang.String error)
-
i_go_to_url
@When("^I go to URL (.+)$") public void i_go_to_url(java.lang.String url) throws java.lang.Exception- Throws:
java.lang.Exception
-
if_alert_visible_accept_alert
@When("if visible I accept alert") public void if_alert_visible_accept_alert()
-
i_click_element_if_visible
@When("^I click element (.+) if visible$") public void i_click_element_if_visible(java.lang.String locatorPath) throws java.io.IOException- Throws:
java.io.IOException
-
test
@When("^Test$") public void test() throws java.lang.Exception- Throws:
java.lang.Exception
-
wait
@When("^I wait for (.+) seconds$") public void wait(int seconds) throws java.lang.Exception- Throws:
java.lang.Exception
-
I_set_property
@When("^I set the property (.+) to (.+)$") public void I_set_property(java.lang.String property, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
-