package it.com.atlassian.stash;

import com.atlassian.webdriver.bitbucket.element.LinkElement;
import com.atlassian.webdriver.bitbucket.page.BitbucketLoginPage;
import org.junit.Test;

import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;

public class WebItemHelpPathTest extends BaseBrowserFuncTest {

    @Test
    public void testHasHelpLink() throws Exception {
        BitbucketLoginPage loginPage = BITBUCKET.visit(BitbucketLoginPage.class);

        LinkElement helpLink = loginPage.getHeader().getHelpLink();
        assertNotNull("Help link should exist on login page", helpLink);
        assertEquals("Help link label", "Help", helpLink.getText());

        assertThat("Help link href should end with Stash+Documentation+Home", containsString("Stash+Documentation+Home"));
    }
}
