package it.com.atlassian.bitbucket.mirror;

import com.atlassian.webdriver.bitbucket.page.AboutPage;
import com.atlassian.webdriver.bitbucket.page.ProjectListPage;
import com.atlassian.webdriver.bitbucket.page.mirror.MirrorNotificationPage;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class MirrorPagesTest extends MirrorTestBase {

    @Test
    public void testCanVisitAboutPage() {
        assertTrue("The about page should be visitable", MIRROR.visit(AboutPage.class).hasCopyrightNotice());
    }

    @Test
    public void testCanVisitMirrorNotificationPage() {
        assertTrue("The mirror notification page should be visitable",
                MIRROR.visit(MirrorNotificationPage.class).hasStatusMessage());
    }

    @Test
    public void testIsRedirectedToMirrorNotificationPage() {
        MirrorNotificationPage page = MIRROR.visit(MirrorNotificationPage.class, new ProjectListPage().getUrl());
        assertTrue("Visiting any other page should redirect to the mirror notification page", page.hasStatusMessage());
    }
}
