package it.com.atlassian.stash;

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

import java.util.HashSet;
import java.util.List;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

public class AboutPageTest extends BaseBrowserFuncTest {
    @Test
    public void gotToAbout() {
        AboutPage aboutPage = BITBUCKET.visit(AboutPage.class); //Should not need to log in
        assertTrue("About page should have copyright notice.", aboutPage.hasCopyrightNotice());

        List<String> authors = aboutPage.getAuthors();
        assertThat(authors, hasSize(greaterThan(35)));
        assertThat(authors, everyItem(not(isEmptyOrNullString())));
        assertThat(new HashSet<>(authors), hasSize(authors.size()));
    }
}
