Skip to content

Instantly share code, notes, and snippets.

@imeredith
Last active May 18, 2017 21:37
Show Gist options
  • Save imeredith/11c23839e3be2c312238a5a62c17e087 to your computer and use it in GitHub Desktop.
Save imeredith/11c23839e3be2c312238a5a62c17e087 to your computer and use it in GitHub Desktop.
FavoritesTest
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