Search in sources :

Example 1 with ProjectsPage

use of pageobjects.projects.ProjectsPage in project sonarqube by SonarSource.

the class ProjectsPageTest method should_open_default_page.

@Test
public void should_open_default_page() {
    // default page can be "All Projects" or "Favorite Projects" depending on your last choice
    ProjectsPage page = nav.openProjects();
    // all projects for anonymous user
    page.shouldHaveTotal(2).shouldDisplayAllProjects();
    // all projects by default for logged in user
    page = nav.logIn().asAdmin().openProjects();
    page.shouldHaveTotal(2).shouldDisplayAllProjects();
    // favorite one project
    wsClient.favorites().add(PROJECT_KEY);
    page = nav.openProjects();
    page.shouldHaveTotal(1).shouldDisplayFavoriteProjects();
    // un-favorite this project
    wsClient.favorites().remove(PROJECT_KEY);
    page = nav.openProjects();
    page.shouldHaveTotal(2).shouldDisplayAllProjects();
    // select favorite
    page.selectFavoriteProjects();
    page = nav.openProjects();
    page.shouldHaveTotal(0).shouldDisplayFavoriteProjects();
    // select all
    page.selectAllProjects();
    page = nav.openProjects();
    page.shouldHaveTotal(2).shouldDisplayAllProjects();
}
Also used : ProjectsPage(pageobjects.projects.ProjectsPage) Test(org.junit.Test)

Example 2 with ProjectsPage

use of pageobjects.projects.ProjectsPage in project sonarqube by SonarSource.

the class ProjectsPageTest method should_display_facets.

@Test
public void should_display_facets() {
    ProjectsPage page = nav.openProjects();
    page.getFacetByProperty("duplications").shouldHaveValue("1", "1").shouldHaveValue("2", "1").shouldHaveValue("3", "1").shouldHaveValue("4", "1").shouldHaveValue("5", "1");
}
Also used : ProjectsPage(pageobjects.projects.ProjectsPage) Test(org.junit.Test)

Example 3 with ProjectsPage

use of pageobjects.projects.ProjectsPage in project sonarqube by SonarSource.

the class ProjectsPageTest method should_search_for_project_and_keep_other_filters.

@Test
public void should_search_for_project_and_keep_other_filters() {
    ProjectsPage page = nav.openProjects();
    page.shouldHaveTotal(2);
    page.getFacetByProperty("duplications").selectValue("3");
    page.shouldHaveTotal(1);
    page.searchProject("sample").shouldHaveTotal(0);
}
Also used : ProjectsPage(pageobjects.projects.ProjectsPage) Test(org.junit.Test)

Example 4 with ProjectsPage

use of pageobjects.projects.ProjectsPage in project sonarqube by SonarSource.

the class ProjectsPageTest method should_display_projects.

@Test
public void should_display_projects() {
    ProjectsPage page = nav.openProjects();
    page.shouldHaveTotal(2);
    page.getProjectByKey(PROJECT_KEY).shouldHaveMeasure("reliability_rating", "A").shouldHaveMeasure("security_rating", "A").shouldHaveMeasure("sqale_rating", "A").shouldHaveMeasure("duplicated_lines_density", "0.0%").shouldHaveMeasure("ncloc", "13").shouldHaveMeasure("ncloc", "Xoo");
}
Also used : ProjectsPage(pageobjects.projects.ProjectsPage) Test(org.junit.Test)

Example 5 with ProjectsPage

use of pageobjects.projects.ProjectsPage in project sonarqube by SonarSource.

the class ProjectsPageTest method should_sort_by_facet.

@Test
public void should_sort_by_facet() {
    ProjectsPage page = nav.openProjects();
    page.getFacetByProperty("duplications").sortListDesc();
    page.getProjectByIdx(0).shouldHaveMeasure("duplicated_lines_density", "63.7%");
    page.getFacetByProperty("duplications").sortListAsc();
    page.getProjectByIdx(0).shouldHaveMeasure("duplicated_lines_density", "0.0%");
}
Also used : ProjectsPage(pageobjects.projects.ProjectsPage) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)9 ProjectsPage (pageobjects.projects.ProjectsPage)9 PostRequest (org.sonarqube.ws.client.PostRequest)1