This file contains hidden or 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
| The server is running | |
| [HTTP] {} | |
| [W3C (2e4a218a)] Calling AppiumDriver.click() with args: ["29da9a26-637d-41f5-ac1b-f4a40bbc2761","2e4a218a-3364-4c4a-9715-7485dbce1c9e"] | |
| [WD Proxy] Matched '/element/29da9a26-637d-41f5-ac1b-f4a40bbc2761/click' to command name 'click' | |
| [WD Proxy] Proxying [POST /element/29da9a26-637d-41f5-ac1b-f4a40bbc2761/click] to [POST http://localhost:8200/wd/hub/session/7d236c89-9c1b-4f02-9be1-ed9234ac6ddd/element/29da9a26-637d-41f5-ac1b-f4a40bbc2761/click] with body: {"element":"29da9a26-637d-41f5-ac1b-f4a40bbc2761"} | |
| [WD Proxy] Got response with status 200: {"sessionId":"7d236c89-9c1b-4f02-9be1-ed9234ac6ddd","value":null} | |
| [W3C (2e4a218a)] Responding to client with driver.click() result: null | |
| [HTTP] <-- POST /wd/hub/session/2e4a218a-3364-4c4a-9715-7485dbce1c9e/element/29da9a26-637d-41f5-ac1b-f4a40bbc2761/click 200 72 ms - 14 | |
| [HTTP] |
This file contains hidden or 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
| require_relative '../spec_helper.rb' | |
| class BasePage < SitePrism::Page | |
| include SitePrism::DSL | |
| @@selector = { ANDROID: :id, IOS: :predicate } | |
| def self.get_default_selector(platform) | |
| if platform.downcase == 'android' | |
| return @@selector[:ANDROID] | |
| elsif platform.downcase == 'ios' |
This file contains hidden or 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
| #inherited DSL module | |
| Include SitePrism::DSL | |
| #single | |
| def self.element(name, *find_args) | |
| m_find_args = find_platform_locator(*find_args) | |
| super(name, *m_find_args) | |
| end | |
| #multiple elements |
This file contains hidden or 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
| def self.find_platform_locator(*find_args) | |
| platform = ENV['PLATFORM'].upcase | |
| #If Android - it will remove second element and use 1st as a locator in a test | |
| if (find_args.length == 2) && (platform == 'ANDROID') | |
| find_args.delete_at(1) | |
| #If iOS - it will remove first element and use second as a locator in a test | |
| elsif (find_args.length == 2) && (platform == 'IOS') | |
| find_args.delete_at(0) |
This file contains hidden or 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
| def self.set_default_selector(android, ios) | |
| @@selector = { ANDROID: android, IOS: ios } | |
| end |
This file contains hidden or 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
| @@selector = { ANDROID: :id, IOS: :predicate } | |
| #after adding variable modification | |
| def self.get_default_selector(platform) | |
| if platform.downcase == 'android' | |
| return @@selector[:ANDROID] | |
| elsif platform.downcase == 'ios' | |
| return @@selector[:IOS] | |
| else | |
| raise ArgumentError, 'Wrong Platform name' |
This file contains hidden or 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
| def self.get_default_selector(platform) | |
| if platform.downcase == 'android' | |
| return :id | |
| elsif platform.downcase == 'ios' | |
| return :predicate | |
| else | |
| raise ArgumentError, 'Wrong Platform Name' | |
| end | |
| end |