package it.com.atlassian.stash;

import com.atlassian.webdriver.bitbucket.page.BitbucketHomePage;
import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class HomePageTest extends BaseBrowserFuncTest {

    private BitbucketHomePage homePage;

    @Test
    public void gotToProjects() {
        homePage = loginAsRegularUser(BitbucketHomePage.class);
        assertFalse("Regular user should not see admin link.", homePage.hasAdminLink());
        assertTrue("Not on the Projects page", homePage.clickProjects().isHere());
    }

    @Test
    public void gotToAdmin() {
        homePage = loginAsAdmin(BitbucketHomePage.class);
        assertTrue("Admin user should see admin link.", homePage.hasAdminLink());
        assertTrue("Not on the Admin page", homePage.clickAdmin().isHere());
    }

}
