Created
March 15, 2018 18:43
-
-
Save andreidbr/10d6ca7325ea5a3b1c183f3ec94fa8ee to your computer and use it in GitHub Desktop.
A Selenium Webdriver test that compares CSS classes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test(testName = "Click 'A' Test", description = "Check that you can click the 'A' key and the correct response triggers", groups = {"01Drums"}) | |
public void aKeyTest() { | |
driver.findElement(By.xpath("/html/body/div[2]/div[1]")).click(); | |
WebElement aKey = driver.findElement(By.xpath("/html/body/div/div[1]")); | |
Actions builder = new Actions(driver); | |
Action sendAKey = builder.moveToElement(aKey).sendKeys("A").build(); | |
sendAKey.perform(); | |
Assert.assertEquals(aKey.getAttribute("class"), "key playing"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment