Last active
May 18, 2017 21:37
-
-
Save imeredith/11c23839e3be2c312238a5a62c17e087 to your computer and use it in GitHub Desktop.
FavoritesTest
This file contains 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
package io.blueocean.ath; | |
import com.mashape.unirest.http.exceptions.UnirestException; | |
import io.blueocean.ath.api.classic.ClassicJobApi; | |
import io.blueocean.ath.pages.blue.DashboardPage; | |
import io.blueocean.ath.pages.classic.LoginPage; | |
import org.junit.Assert; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.openqa.selenium.WebDriver; | |
import javax.inject.Inject; | |
import java.io.IOException; | |
@RunWith(ATHJUnitRunner.class) | |
public class FavoritesTest { | |
@Inject | |
LoginPage loginPage; | |
@Inject | |
DashboardPage dashboardPage; | |
@Inject | |
ClassicJobApi jobApi; | |
@Inject | |
WebDriver driver; | |
@Test | |
public void testFavorite() throws InterruptedException, UnirestException, IOException { | |
String jobName = "favoriteJob"; | |
loginPage.login(); | |
jobApi.createFreeStyleJob(jobName, "echo hi"); | |
dashboardPage.open(); | |
Assert.assertFalse(dashboardPage.isFavorite(jobName)); | |
dashboardPage.toggleFavorite(jobName); | |
Assert.assertTrue(dashboardPage.isFavorite(jobName)); | |
dashboardPage.toggleFavorite(jobName); | |
Assert.assertFalse(dashboardPage.isFavorite(jobName)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment