diff options
author | Phil Hughes <me@iamphill.com> | 2016-08-12 10:10:59 +0100 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-08-13 00:57:40 -0500 |
commit | 61bdc80dbad253f6532a83ae2554de82deb40e5f (patch) | |
tree | f043c15e862ef690be29d53368cbab7a84b37194 /features | |
parent | 59955fbbbd5f807654e0861f49b182f27654d4cc (diff) | |
download | gitlab-ce-61bdc80dbad253f6532a83ae2554de82deb40e5f.tar.gz |
Updated failing tests
Diffstat (limited to 'features')
-rw-r--r-- | features/steps/dashboard/dashboard.rb | 1 | ||||
-rw-r--r-- | features/steps/dashboard/event_filters.rb | 10 | ||||
-rw-r--r-- | features/steps/project/source/browse_files.rb | 1 | ||||
-rw-r--r-- | features/support/wait_for_ajax.rb | 11 |
4 files changed, 23 insertions, 0 deletions
diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index 80ed4c6d64c..a7d61bc28e0 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -26,6 +26,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps end step 'I see prefilled new Merge Request page' do + expect(page).to have_selector('.merge-request-form') expect(current_path).to eq new_namespace_project_merge_request_path(@project.namespace, @project) expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s expect(find("input#merge_request_source_branch").value).to eq "fix" diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb index 97b17abb470..1806bb138eb 100644 --- a/features/steps/dashboard/event_filters.rb +++ b/features/steps/dashboard/event_filters.rb @@ -1,34 +1,44 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps + include WaitForAjax include SharedAuthentication include SharedPaths include SharedProject step 'I should see push event' do + wait_for_ajax sleep 1 expect(page).to have_selector('span.pushed') end step 'I should not see push event' do + wait_for_ajax + save_and_open_screenshot sleep 1 + save_and_open_screenshot expect(page).not_to have_selector('span.pushed') + save_and_open_screenshot end step 'I should see new member event' do + wait_for_ajax sleep 1 expect(page).to have_selector('span.joined') end step 'I should not see new member event' do + wait_for_ajax sleep 1 expect(page).not_to have_selector('span.joined') end step 'I should see merge request event' do + wait_for_ajax sleep 1 expect(page).to have_selector('span.accepted') end step 'I should not see merge request event' do + wait_for_ajax sleep 1 expect(page).not_to have_selector('span.accepted') end diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 2b74e964ca1..841d191d55b 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -132,6 +132,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I click on "New file" link in repo' do find('.add-to-tree').click click_link 'New file' + expect(page).to have_selector('.file-editor') end step 'I click on "Upload file" link in repo' do diff --git a/features/support/wait_for_ajax.rb b/features/support/wait_for_ajax.rb new file mode 100644 index 00000000000..b90fc112671 --- /dev/null +++ b/features/support/wait_for_ajax.rb @@ -0,0 +1,11 @@ +module WaitForAjax + def wait_for_ajax + Timeout.timeout(Capybara.default_max_wait_time) do + loop until finished_all_ajax_requests? + end + end + + def finished_all_ajax_requests? + page.evaluate_script('jQuery.active').zero? + end +end |