Commit f668da11 authored by Phil Hughes's avatar Phil Hughes Committed by Alfredo Sumaran

Updated tests

parent 2675c9d6
...@@ -4,26 +4,32 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps ...@@ -4,26 +4,32 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
include SharedProject include SharedProject
step 'I should see push event' do step 'I should see push event' do
sleep 1
expect(page).to have_selector('span.pushed') expect(page).to have_selector('span.pushed')
end end
step 'I should not see push event' do step 'I should not see push event' do
sleep 1
expect(page).not_to have_selector('span.pushed') expect(page).not_to have_selector('span.pushed')
end end
step 'I should see new member event' do step 'I should see new member event' do
sleep 1
expect(page).to have_selector('span.joined') expect(page).to have_selector('span.joined')
end end
step 'I should not see new member event' do step 'I should not see new member event' do
sleep 1
expect(page).not_to have_selector('span.joined') expect(page).not_to have_selector('span.joined')
end end
step 'I should see merge request event' do step 'I should see merge request event' do
sleep 1
expect(page).to have_selector('span.accepted') expect(page).to have_selector('span.accepted')
end end
step 'I should not see merge request event' do step 'I should not see merge request event' do
sleep 1
expect(page).not_to have_selector('span.accepted') expect(page).not_to have_selector('span.accepted')
end end
......
...@@ -43,9 +43,14 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps ...@@ -43,9 +43,14 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
step 'I click "All" link' do step 'I click "All" link' do
find(".js-author-search").click find(".js-author-search").click
expect(page).to have_selector(".dropdown-menu-author li a")
find(".dropdown-menu-author li a", match: :first).click find(".dropdown-menu-author li a", match: :first).click
expect(page).not_to have_selector(".dropdown-menu-author li a")
find(".js-assignee-search").click find(".js-assignee-search").click
expect(page).to have_selector(".dropdown-menu-assignee li a")
find(".dropdown-menu-assignee li a", match: :first).click find(".dropdown-menu-assignee li a", match: :first).click
expect(page).not_to have_selector(".dropdown-menu-assignee li a")
end end
def should_see(issue) def should_see(issue)
......
...@@ -47,9 +47,14 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps ...@@ -47,9 +47,14 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
step 'I click "All" link' do step 'I click "All" link' do
find(".js-author-search").click find(".js-author-search").click
expect(page).to have_selector(".dropdown-menu-author li a")
find(".dropdown-menu-author li a", match: :first).click find(".dropdown-menu-author li a", match: :first).click
expect(page).not_to have_selector(".dropdown-menu-author li a")
find(".js-assignee-search").click find(".js-assignee-search").click
expect(page).to have_selector(".dropdown-menu-assignee li a")
find(".dropdown-menu-assignee li a", match: :first).click find(".dropdown-menu-assignee li a", match: :first).click
expect(page).not_to have_selector(".dropdown-menu-assignee li a")
end end
def should_see(merge_request) def should_see(merge_request)
......
...@@ -29,6 +29,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps ...@@ -29,6 +29,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
end end
step 'I am redirected to the GitHub import page' do step 'I am redirected to the GitHub import page' do
expect(page).to have_content('Import Projects from GitHub')
expect(current_path).to eq new_import_github_path expect(current_path).to eq new_import_github_path
end end
...@@ -47,6 +48,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps ...@@ -47,6 +48,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
end end
step 'I redirected to Google Code import page' do step 'I redirected to Google Code import page' do
expect(page).to have_content('Import projects from Google Code')
expect(current_path).to eq new_import_google_code_path expect(current_path).to eq new_import_google_code_path
end end
end end
...@@ -10,6 +10,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps ...@@ -10,6 +10,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps
step 'I click artifacts browse button' do step 'I click artifacts browse button' do
click_link 'Browse' click_link 'Browse'
expect(page).not_to have_selector('.build-sidebar')
end end
step 'I should see content of artifacts archive' do step 'I should see content of artifacts archive' do
......
...@@ -34,6 +34,9 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps ...@@ -34,6 +34,9 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end end
step 'I fill out a "Merge Request On Forked Project" merge request' do step 'I fill out a "Merge Request On Forked Project" merge request' do
expect(page).to have_content('Source branch')
expect(page).to have_content('Target branch')
first('.js-source-project').click first('.js-source-project').click
first('.dropdown-source-project a', text: @forked_project.path_with_namespace) first('.dropdown-source-project a', text: @forked_project.path_with_namespace)
......
...@@ -355,5 +355,6 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps ...@@ -355,5 +355,6 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
def filter_issue(text) def filter_issue(text)
fill_in 'issue_search', with: text fill_in 'issue_search', with: text
find('#issue_search').native.send_keys(:return)
end end
end end
...@@ -489,10 +489,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -489,10 +489,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end end
step 'I fill in merge request search with "Fe"' do step 'I fill in merge request search with "Fe"' do
sleep 1
fill_in 'issue_search', with: "Fe" fill_in 'issue_search', with: "Fe"
end end
step 'I click the "Target branch" dropdown' do step 'I click the "Target branch" dropdown' do
expect(page).to have_content('Target branch')
first('.target_branch').click first('.target_branch').click
end end
......
...@@ -69,6 +69,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps ...@@ -69,6 +69,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end end
step 'I edit code' do step 'I edit code' do
expect(page).to have_selector('.file-editor')
set_new_content set_new_content
end end
......
...@@ -142,7 +142,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps ...@@ -142,7 +142,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end end
step 'I edit the Wiki page with a path' do step 'I edit the Wiki page with a path' do
expect(page).to have_content('three')
click_on 'three' click_on 'three'
expect(find('.nav-text')).to have_content('Three')
click_on 'Edit' click_on 'Edit'
end end
......
...@@ -133,9 +133,7 @@ module SharedIssuable ...@@ -133,9 +133,7 @@ module SharedIssuable
end end
step 'The list should be sorted by "Oldest updated"' do step 'The list should be sorted by "Oldest updated"' do
page.within('.content div.dropdown.inline.prepend-left-10') do expect(find('.issues-filters')).to have_content('Oldest updated')
expect(page.find('button.dropdown-toggle.btn')).to have_content('Oldest updated')
end
end end
step 'I click link "Next" in the sidebar' do step 'I click link "Next" in the sidebar' do
......
...@@ -55,7 +55,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do ...@@ -55,7 +55,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do
it 'is "last updated"' do it 'is "last updated"' do
visit_merge_requests_with_state(project, 'merged') visit_merge_requests_with_state(project, 'merged')
expect(selected_sort_order).to eq('last updated') expect(find('.issues-other-filters')).to have_content('Last updated')
expect(first_merge_request).to include(last_updated_issuable.title) expect(first_merge_request).to include(last_updated_issuable.title)
expect(last_merge_request).to include(first_updated_issuable.title) expect(last_merge_request).to include(first_updated_issuable.title)
end end
...@@ -67,7 +67,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do ...@@ -67,7 +67,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do
it 'is "last updated"' do it 'is "last updated"' do
visit_merge_requests_with_state(project, 'closed') visit_merge_requests_with_state(project, 'closed')
expect(selected_sort_order).to eq('last updated') expect(find('.issues-other-filters')).to have_content('Last updated')
expect(first_merge_request).to include(last_updated_issuable.title) expect(first_merge_request).to include(last_updated_issuable.title)
expect(last_merge_request).to include(first_updated_issuable.title) expect(last_merge_request).to include(first_updated_issuable.title)
end end
...@@ -79,7 +79,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do ...@@ -79,7 +79,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do
it 'is "last created"' do it 'is "last created"' do
visit_merge_requests_with_state(project, 'all') visit_merge_requests_with_state(project, 'all')
expect(selected_sort_order).to eq('last created') expect(find('.issues-other-filters')).to have_content('Last created')
expect(first_merge_request).to include(last_created_issuable.title) expect(first_merge_request).to include(last_created_issuable.title)
expect(last_merge_request).to include(first_created_issuable.title) expect(last_merge_request).to include(first_created_issuable.title)
end end
...@@ -108,7 +108,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do ...@@ -108,7 +108,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do
it 'is "last created"' do it 'is "last created"' do
visit_issues project visit_issues project
expect(selected_sort_order).to eq('last created') expect(find('.issues-other-filters')).to have_content('Last created')
expect(first_issue).to include(last_created_issuable.title) expect(first_issue).to include(last_created_issuable.title)
expect(last_issue).to include(first_created_issuable.title) expect(last_issue).to include(first_created_issuable.title)
end end
...@@ -120,7 +120,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do ...@@ -120,7 +120,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do
it 'is "last created"' do it 'is "last created"' do
visit_issues_with_state(project, 'open') visit_issues_with_state(project, 'open')
expect(selected_sort_order).to eq('last created') expect(find('.issues-other-filters')).to have_content('Last created')
expect(first_issue).to include(last_created_issuable.title) expect(first_issue).to include(last_created_issuable.title)
expect(last_issue).to include(first_created_issuable.title) expect(last_issue).to include(first_created_issuable.title)
end end
...@@ -132,7 +132,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do ...@@ -132,7 +132,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do
it 'is "last updated"' do it 'is "last updated"' do
visit_issues_with_state(project, 'closed') visit_issues_with_state(project, 'closed')
expect(selected_sort_order).to eq('last updated') expect(find('.issues-other-filters')).to have_content('Last updated')
expect(first_issue).to include(last_updated_issuable.title) expect(first_issue).to include(last_updated_issuable.title)
expect(last_issue).to include(first_updated_issuable.title) expect(last_issue).to include(first_updated_issuable.title)
end end
...@@ -144,7 +144,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do ...@@ -144,7 +144,7 @@ describe 'Projects > Issuables > Default sort order', feature: true do
it 'is "last created"' do it 'is "last created"' do
visit_issues_with_state(project, 'all') visit_issues_with_state(project, 'all')
expect(selected_sort_order).to eq('last created') expect(find('.issues-other-filters')).to have_content('Last created')
expect(first_issue).to include(last_created_issuable.title) expect(first_issue).to include(last_created_issuable.title)
expect(last_issue).to include(first_created_issuable.title) expect(last_issue).to include(first_created_issuable.title)
end end
......
...@@ -117,7 +117,7 @@ describe 'Filter issues', feature: true do ...@@ -117,7 +117,7 @@ describe 'Filter issues', feature: true do
find('.dropdown-menu-user-link', text: user.username).click find('.dropdown-menu-user-link', text: user.username).click
wait_for_ajax expect(page).not_to have_selector('.issues-list .issue')
find('.js-label-select').click find('.js-label-select').click
......
...@@ -13,6 +13,8 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -13,6 +13,8 @@ feature 'Create New Merge Request', feature: true, js: true do
it 'generates a diff for an orphaned branch' do it 'generates a diff for an orphaned branch' do
click_link 'New Merge Request' click_link 'New Merge Request'
expect(page).to have_content('Source branch')
expect(page).to have_content('Target branch')
first('.js-source-branch').click first('.js-source-branch').click
first('.dropdown-source-branch .dropdown-content a', text: 'orphaned-branch').click first('.dropdown-source-branch .dropdown-content a', text: 'orphaned-branch').click
......
...@@ -68,10 +68,14 @@ describe 'Profile > Preferences', feature: true do ...@@ -68,10 +68,14 @@ describe 'Profile > Preferences', feature: true do
allowing_for_delay do allowing_for_delay do
find('#logo').click find('#logo').click
expect(page).to have_content('You don\'t have starred projects yet')
expect(page.current_path).to eq starred_dashboard_projects_path expect(page.current_path).to eq starred_dashboard_projects_path
end end
click_link 'Your Projects' click_link 'Your Projects'
expect(page).not_to have_content('You don\'t have starred projects yet')
expect(page.current_path).to eq dashboard_projects_path expect(page.current_path).to eq dashboard_projects_path
end end
end end
......
...@@ -39,6 +39,7 @@ feature 'project owner creates a license file', feature: true, js: true do ...@@ -39,6 +39,7 @@ feature 'project owner creates a license file', feature: true, js: true do
scenario 'project master creates a license file from the "Add license" link' do scenario 'project master creates a license file from the "Add license" link' do
click_link 'Add License' click_link 'Add License'
expect(page).to have_content('New File')
expect(current_path).to eq( expect(current_path).to eq(
namespace_project_new_blob_path(project.namespace, project, 'master')) namespace_project_new_blob_path(project.namespace, project, 'master'))
expect(find('#file_name').value).to eq('LICENSE') expect(find('#file_name').value).to eq('LICENSE')
......
...@@ -14,6 +14,7 @@ feature 'project owner sees a link to create a license file in empty project', f ...@@ -14,6 +14,7 @@ feature 'project owner sees a link to create a license file in empty project', f
visit namespace_project_path(project.namespace, project) visit namespace_project_path(project.namespace, project)
click_link 'Create empty bare repository' click_link 'Create empty bare repository'
click_on 'LICENSE' click_on 'LICENSE'
expect(page).to have_content('New File')
expect(current_path).to eq( expect(current_path).to eq(
namespace_project_new_blob_path(project.namespace, project, 'master')) namespace_project_new_blob_path(project.namespace, project, 'master'))
......
...@@ -42,6 +42,7 @@ describe 'Project variables', js: true do ...@@ -42,6 +42,7 @@ describe 'Project variables', js: true do
find('.btn-variable-edit').click find('.btn-variable-edit').click
end end
expect(page).to have_content('Update variable')
fill_in('variable_key', with: 'key') fill_in('variable_key', with: 'key')
fill_in('variable_value', with: 'key value') fill_in('variable_value', with: 'key value')
click_button('Save variable') click_button('Save variable')
......
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