BigW Consortium Gitlab

Commit 4e8a2feb by Mehdi Lahmam

Add feature specs for Cycle Analytics pipeline summary

parent 3254ad4d
...@@ -24,6 +24,12 @@ feature 'Cycle Analytics', js: true do ...@@ -24,6 +24,12 @@ feature 'Cycle Analytics', js: true do
expect(page).to have_content('Introducing Cycle Analytics') expect(page).to have_content('Introducing Cycle Analytics')
end end
it 'shows pipeline summary' do
expect(new_issues_counter).to have_content('-')
expect(commits_counter).to have_content('-')
expect(deploys_counter).to have_content('-')
end
it 'shows active stage with empty message' do it 'shows active stage with empty message' do
expect(page).to have_selector('.stage-nav-item.active', text: 'Issue') expect(page).to have_selector('.stage-nav-item.active', text: 'Issue')
expect(page).to have_content("We don't have enough data to show this stage.") expect(page).to have_content("We don't have enough data to show this stage.")
...@@ -42,6 +48,12 @@ feature 'Cycle Analytics', js: true do ...@@ -42,6 +48,12 @@ feature 'Cycle Analytics', js: true do
visit project_cycle_analytics_path(project) visit project_cycle_analytics_path(project)
end end
it 'shows pipeline summary' do
expect(new_issues_counter).to have_content('1')
expect(commits_counter).to have_content('2')
expect(deploys_counter).to have_content('1')
end
it 'shows data on each stage' do it 'shows data on each stage' do
expect_issue_to_be_present expect_issue_to_be_present
...@@ -109,6 +121,18 @@ feature 'Cycle Analytics', js: true do ...@@ -109,6 +121,18 @@ feature 'Cycle Analytics', js: true do
end end
end end
def new_issues_counter
find(:xpath, "//p[contains(text(),'New Issue')]/preceding-sibling::h3")
end
def commits_counter
find(:xpath, "//p[contains(text(),'Commits')]/preceding-sibling::h3")
end
def deploys_counter
find(:xpath, "//p[contains(text(),'Deploy')]/preceding-sibling::h3")
end
def expect_issue_to_be_present def expect_issue_to_be_present
expect(find('.stage-events')).to have_content(issue.title) expect(find('.stage-events')).to have_content(issue.title)
expect(find('.stage-events')).to have_content(issue.author.name) expect(find('.stage-events')).to have_content(issue.author.name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment