Search in sources :

Example 21 with Location

use of com.google.container.v1beta1.Location in project java-container by googleapis.

the class ClusterManagerClientTest method listLocationsTest.

@Test
public void listLocationsTest() throws Exception {
    ListLocationsResponse expectedResponse = ListLocationsResponse.newBuilder().addAllLocations(new ArrayList<Location>()).setNextPageToken("nextPageToken-1386094857").build();
    mockClusterManager.addResponse(expectedResponse);
    String parent = "parent-995424086";
    ListLocationsResponse actualResponse = client.listLocations(parent);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0));
    Assert.assertEquals(parent, actualRequest.getParent());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : ListLocationsResponse(com.google.container.v1beta1.ListLocationsResponse) AbstractMessage(com.google.protobuf.AbstractMessage) ListLocationsRequest(com.google.container.v1beta1.ListLocationsRequest) Location(com.google.container.v1beta1.Location) Test(org.junit.Test)

Example 22 with Location

use of com.google.container.v1beta1.Location in project selenium-webdriver-java by bonigarcia.

the class LocationContextSelJupTest method testLocationContext.

@Test
void testLocationContext(ChromeDriver driver) {
    LocationContext location = (LocationContext) driver;
    location.setLocation(new Location(27.5916, 86.5640, 8850));
    driver.get("https://bonigarcia.dev/selenium-webdriver-java/geolocation.html");
    driver.findElement(By.id("get-coordinates")).click();
    WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5));
    WebElement coordinates = driver.findElement(By.id("coordinates"));
    wait.until(ExpectedConditions.visibilityOf(coordinates));
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) LocationContext(org.openqa.selenium.html5.LocationContext) WebElement(org.openqa.selenium.WebElement) Location(org.openqa.selenium.html5.Location) Test(org.junit.jupiter.api.Test)

Example 23 with Location

use of com.google.container.v1beta1.Location in project selenium-webdriver-java by bonigarcia.

the class LocationContextJUnit4Test method testLocationContext.

@Test
public void testLocationContext() {
    LocationContext location = (LocationContext) driver;
    location.setLocation(new Location(27.5916, 86.5640, 8850));
    driver.get("https://bonigarcia.dev/selenium-webdriver-java/geolocation.html");
    driver.findElement(By.id("get-coordinates")).click();
    WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5));
    WebElement coordinates = driver.findElement(By.id("coordinates"));
    wait.until(ExpectedConditions.visibilityOf(coordinates));
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) LocationContext(org.openqa.selenium.html5.LocationContext) WebElement(org.openqa.selenium.WebElement) Location(org.openqa.selenium.html5.Location) Test(org.junit.Test)

Example 24 with Location

use of com.google.container.v1beta1.Location in project selenium-webdriver-java by bonigarcia.

the class LocationContextJupiterTest method testLocationContext.

@Test
void testLocationContext() {
    LocationContext location = (LocationContext) driver;
    location.setLocation(new Location(27.5916, 86.5640, 8850));
    driver.get("https://bonigarcia.dev/selenium-webdriver-java/geolocation.html");
    driver.findElement(By.id("get-coordinates")).click();
    WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5));
    WebElement coordinates = driver.findElement(By.id("coordinates"));
    wait.until(ExpectedConditions.visibilityOf(coordinates));
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) LocationContext(org.openqa.selenium.html5.LocationContext) WebElement(org.openqa.selenium.WebElement) Location(org.openqa.selenium.html5.Location) Test(org.junit.jupiter.api.Test)

Aggregations

Random (java.util.Random)8 Location (org.openqa.selenium.html5.Location)7 Test (org.junit.Test)5 LocationContext (org.openqa.selenium.html5.LocationContext)5 WebElement (org.openqa.selenium.WebElement)3 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)3 AdUnitTargeting (com.google.api.ads.admanager.axis.v202108.AdUnitTargeting)2 GeoTargeting (com.google.api.ads.admanager.axis.v202108.GeoTargeting)2 InventoryTargeting (com.google.api.ads.admanager.axis.v202108.InventoryTargeting)2 Location (com.google.api.ads.admanager.axis.v202108.Location)2 NetworkServiceInterface (com.google.api.ads.admanager.axis.v202108.NetworkServiceInterface)2 Targeting (com.google.api.ads.admanager.axis.v202108.Targeting)2 AdUnitTargeting (com.google.api.ads.admanager.axis.v202111.AdUnitTargeting)2 GeoTargeting (com.google.api.ads.admanager.axis.v202111.GeoTargeting)2 InventoryTargeting (com.google.api.ads.admanager.axis.v202111.InventoryTargeting)2 Location (com.google.api.ads.admanager.axis.v202111.Location)2 NetworkServiceInterface (com.google.api.ads.admanager.axis.v202111.NetworkServiceInterface)2 Targeting (com.google.api.ads.admanager.axis.v202111.Targeting)2 AdUnitTargeting (com.google.api.ads.admanager.axis.v202202.AdUnitTargeting)2 GeoTargeting (com.google.api.ads.admanager.axis.v202202.GeoTargeting)2