All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.telekom.test.bddwebapp.frontend.page.UrlMatchesExpectation Maven / Gradle / Ivy

There is a newer version: 3.2
Show newest version
package de.telekom.test.bddwebapp.frontend.page;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;

/**
 * ExpectedCondition for url matching.
 *
 * @author Daniel Keiss {@literal }
 * 

* Copyright (c) 2018 Daniel Keiss, Deutsche Telekom AG * This file is distributed under the conditions of the Apache License, Version 2.0. * For details see the file license on the toplevel. */ public class UrlMatchesExpectation implements ExpectedCondition { private final String detail; private final String urlToMatch; public UrlMatchesExpectation(String urlToMatch, String detail) { this.urlToMatch = urlToMatch; this.detail = detail; } @Override public Boolean apply(WebDriver driver) { String regex = ".*" + urlToMatch + ".*"; // contains return driver.getCurrentUrl().matches(regex); } @Override public String toString() { return detail; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy