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
package utilities; | |
import io.github.bonigarcia.wdm.WebDriverManager; | |
import org.openqa.selenium.Dimension; | |
import org.openqa.selenium.InvalidArgumentException; | |
import org.openqa.selenium.Point; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeOptions; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.openqa.selenium.firefox.FirefoxDriver; |
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
package com.softalp.viner.utils; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.telephony.TelephonyManager; | |
public class NetworkType { | |
private Context context; |
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
public static void uploadFile(WebElement uploadField, String name) throws InterruptedException, IOException { | |
File file = new File("src/main/resources/test.pdf"); | |
String absolutePath = file.getAbsolutePath(); | |
System.out.println("\n\nFile absolute path: " + absolutePath + "\n\n"); | |
uploadField.sendKeys(absolutePath); | |
Thread.sleep(100 * 1000); |
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
/** | |
* Differ from Mink as does not have fixStepArgument check | |
* Fills in form field with specified id|name|label|value | |
* Example: When I fill in "username" with: "bwayne" | |
* Example: And I fill in "bwayne" for "username" | |
* @When /^(?:|I )fill in field "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/ | |
* @param $field | |
* @param $value | |
* @throws \Behat\Mink\Exception\ElementNotFoundException | |
*/ |
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
/** | |
* Wait for function return true, trying to execute it number of times | |
* @param $lambda | |
* @param int $tries | |
* @return bool | |
* @throws Exception | |
*/ | |
public function spin($lambda, $tries = 60) | |
{ | |
for ($i = 0; $i < $tries; $i++) { |
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
/** | |
* @Given I switch to iframe with locator :locator | |
* @param String $locator | |
*/ | |
public function iSwitchToIFrameWithLocator($locator) | |
{ | |
$value = $this->takeValueFromIniFile('locators', $locator); | |
$iframe = $this->getSession()->getPage()->find("css", $value); | |
$iframeName = $iframe->getAttribute("name"); | |
if ($iframeName == "") { |