KEYCLOAK-2913 Switch to use xpath for finding links instead of adding an
id.
This commit is contained in:
parent
049b0dda23
commit
8d56ab90ba
4 changed files with 4 additions and 4 deletions
|
@ -46,7 +46,7 @@ public abstract class AbstractAccountPage extends AbstractPage {
|
|||
}
|
||||
|
||||
public void openLanguage(String language){
|
||||
WebElement langLink = localeDropdown.findElement(By.id("kc-locale-" + language));
|
||||
WebElement langLink = localeDropdown.findElement(By.xpath("//a[text()='" +language +"']"));
|
||||
String url = langLink.getAttribute("href");
|
||||
driver.navigate().to(url);
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ public class LoginPage extends AbstractPage {
|
|||
}
|
||||
|
||||
public void openLanguage(String language){
|
||||
WebElement langLink = localeDropdown.findElement(By.id("kc-locale-" + language));
|
||||
WebElement langLink = localeDropdown.findElement(By.xpath("//a[text()='" +language +"']"));
|
||||
String url = langLink.getAttribute("href");
|
||||
driver.navigate().to(url);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<a href="#" id="kc-current-locale-link">${locale.current}</a>
|
||||
<ul>
|
||||
<#list locale.supported as l>
|
||||
<li class="kc-dropdown-item"><a href="${l.url}" id="kc-locale-${l.label}">${l.label}</a></li>
|
||||
<li class="kc-dropdown-item"><a href="${l.url}">${l.label}</a></li>
|
||||
</#list>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<a href="#" id="kc-current-locale-link">${locale.current}</a>
|
||||
<ul>
|
||||
<#list locale.supported as l>
|
||||
<li class="kc-dropdown-item"><a href="${l.url}" id="kc-locale-${l.label}">${l.label}</a></li>
|
||||
<li class="kc-dropdown-item"><a href="${l.url}">${l.label}</a></li>
|
||||
</#list>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue