Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mialeska committed Jan 19, 2024
1 parent dfc8ed6 commit 34660a8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/test/java/forms/MyLocationForm.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package forms;

import aquality.selenium.elements.interfaces.IButton;
import aquality.selenium.elements.interfaces.ILabel;
import aquality.selenium.forms.Form;
import org.openqa.selenium.By;
Expand All @@ -8,13 +9,21 @@ public class MyLocationForm extends Form {

private final ILabel lblLatitude = getElementFactory().getLabel(By.id("latitude"), "Latitude");
private final ILabel lblLongitude = getElementFactory().getLabel(By.id("longitude"), "Longitude");
private final IButton btnConsent = getElementFactory().getButton(By.xpath("//button[@aria-label='Consent']"), "Consent");

public MyLocationForm() {
super(By.xpath("//h1[contains(text(),'My Location')]"), "My Location");
}

public double getLatitude() {
return Double.parseDouble(lblLatitude.getText());
if (!lblLatitude.state().isDisplayed() && btnConsent.state().isDisplayed()) {
clickConsent();
}
return Double.parseDouble(lblLatitude.getText());
}

public void clickConsent() {
btnConsent.click();
}

public double getLongitude() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/theinternet/forms/JQueryMenuForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.openqa.selenium.By;

public class JQueryMenuForm extends TheInternetForm {
private final IButton btnEnabled = getElementFactory().getButton(By.id("ui-id-2"), "Enabled");
private final IButton btnEnabled = getElementFactory().getButton(By.id("ui-id-3"), "Enabled");

public JQueryMenuForm(){
super(By.id("menu"), "JQueryUI menu");
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/theinternet/forms/TheInternetForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public abstract class TheInternetForm extends Form {
super(locator, name);
}

private static final String THE_INTERNET_FORM_URL = "http://the-internet.herokuapp.com";
private static final String THE_INTERNET_FORM_URL = "https://the-internet.herokuapp.com";
private final ILink elementalSeleniumLink = getElementFactory().getLink(By.xpath("//a[contains(@href,'elementalselenium')]"), "Elemental Selenium");

public String getUrl() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"browserName" : "iexplorer",
"browserName" : "chrome",
"isRemote": false,
"remoteConnectionUrl": "http://localhost:4444/wd/hub",
"isElementHighlightEnabled" : true,
Expand Down

0 comments on commit 34660a8

Please sign in to comment.