Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anandbagmar committed Oct 4, 2024
1 parent 8d57653 commit a45737d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/main/java/utilities/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ private static WebDriver createExecutionCloudRemoteDriver() {
}

String executionCloudURL = Eyes.getExecutionCloudURL();
System.out.println("executionCloudURL: " + executionCloudURL);
try {
innerDriver = new RemoteWebDriver(new URI(executionCloudURL).toURL(), capabilities);
} catch (MalformedURLException | URISyntaxException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.applitools.eyes.selenium.Configuration;
import com.applitools.eyes.selenium.Eyes;
import com.applitools.eyes.selenium.fluent.Target;
import com.applitools.eyes.visualgrid.model.DeviceName;
import com.applitools.eyes.visualgrid.model.ScreenOrientation;
import com.applitools.eyes.visualgrid.services.RunnerOptions;
import com.applitools.eyes.visualgrid.services.VisualGridRunner;
import org.junit.jupiter.api.*;
Expand Down Expand Up @@ -78,12 +80,19 @@ public void beforeMethod(TestInfo testInfo) {
config.setAccessibilityValidation(new AccessibilitySettings(AccessibilityLevel.AA, AccessibilityGuidelinesVersion.WCAG_2_1));

// Add browsers with different viewports
config.addBrowser(800, 600, BrowserType.CHROME);
config.addBrowser(700, 500, BrowserType.FIREFOX);
config.addBrowser(1200, 600, BrowserType.CHROME);
config.addBrowser(1800, 600, BrowserType.CHROME);
config.addBrowser(1300, 600, BrowserType.CHROME);
config.addBrowser(1200, 1600, BrowserType.CHROME);
config.addBrowser(1400, 500, BrowserType.FIREFOX);
config.addBrowser(1400, 500, BrowserType.EDGE);
config.addBrowser(1400, 500, BrowserType.SAFARI);

// Add mobile emulation devices in Portrait/Landscape mode
// config.addDeviceEmulation(DeviceName.iPhone_X, ScreenOrientation.PORTRAIT);
// config.addDeviceEmulation(DeviceName.Pixel_2, ScreenOrientation.PORTRAIT);
config.addDeviceEmulation(DeviceName.iPhone_X, ScreenOrientation.PORTRAIT);
config.addDeviceEmulation(DeviceName.Pixel_2, ScreenOrientation.PORTRAIT);
config.addDeviceEmulation(DeviceName.Galaxy_S22_Ultra, ScreenOrientation.PORTRAIT);
config.addDeviceEmulation(DeviceName.iPad, ScreenOrientation.PORTRAIT);

eyes.setConfiguration(config);
eyes.setLogHandler(new StdoutLogHandler(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import org.junit.jupiter.api.*;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import utilities.Driver;

import static utilities.Wait.waitFor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,20 @@ public void beforeMethod(TestInfo testInfo) {
config.addProperty("username", userName);
// Add browsers with different viewports
config.addBrowser(1400, 1000, BrowserType.CHROME);
config.addBrowser(1400, 1000, BrowserType.CHROME_ONE_VERSION_BACK);
config.addBrowser(1400, 1000, BrowserType.CHROME_TWO_VERSIONS_BACK);
config.addBrowser(1200, 1024, BrowserType.FIREFOX);
config.addBrowser(700, 500, BrowserType.FIREFOX_ONE_VERSION_BACK);
config.addBrowser(1700, 500, BrowserType.FIREFOX_ONE_VERSION_BACK);
config.addBrowser(1024, 768, BrowserType.EDGE_CHROMIUM);
config.addBrowser(1024, 768, BrowserType.EDGE_CHROMIUM_ONE_VERSION_BACK);
config.addBrowser(800, 600, BrowserType.SAFARI);
config.addBrowser(800, 600, BrowserType.SAFARI_ONE_VERSION_BACK);
config.addBrowser(1800, 600, BrowserType.SAFARI);
config.addBrowser(800, 1600, BrowserType.SAFARI_ONE_VERSION_BACK);

// Add mobile emulation devices in Portrait/Landscape mode
config.addDeviceEmulation(DeviceName.iPad_Pro, ScreenOrientation.LANDSCAPE);
config.addDeviceEmulation(DeviceName.iPhone_11, ScreenOrientation.PORTRAIT);
config.addDeviceEmulation(DeviceName.Galaxy_Note_2, ScreenOrientation.PORTRAIT);
config.addDeviceEmulation(DeviceName.Galaxy_Tab_S7, ScreenOrientation.LANDSCAPE);

eyes.setConfiguration(config);
eyes.setLogHandler(new StdoutLogHandler(true));
Expand Down Expand Up @@ -135,6 +138,8 @@ void seleniumUFGTest() {
}
driver.findElement(By.id("clickButton")).click();
eyes.checkWindow("After click");
eyes.check("combo", Target.window().fully().layout(By.xpath("//p[contains(text(), 'Applitools')]"), By.xpath("//span[contains(@class,'random-number')]")));
eyes.check("combo", Target.window().fully()
.layout(By.xpath("//p[contains(text(), 'Applitools')]"),
By.xpath("//span[contains(@class,'random-number')]")));
}
}

0 comments on commit a45737d

Please sign in to comment.