Коммит ac3b6ae2 создал по автору Jose Ivan Vargas's avatar Jose Ivan Vargas
Просмотр файлов

Added/corrected specs

владелец c60f32d5
......@@ -20,13 +20,6 @@ Feature: Project Commits Branches
And I submit new branch form
Then I should see new branch created
@javascript
Scenario: I delete a branch
Given I visit project branches page
And I filter for branch improve/awesome
And I click branch 'improve/awesome' delete link
Then I should not see branch 'improve/awesome'
@javascript
Scenario: I create a branch with invalid name
Given I visit project branches page
......
......@@ -64,21 +64,6 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps
expect(page).to have_content 'Branch already exists'
end
step 'I filter for branch improve/awesome' do
fill_in 'branch-search', with: 'improve/awesome'
find('#branch-search').native.send_keys(:enter)
end
step "I click branch 'improve/awesome' delete link" do
page.within '.js-branch-improve\/awesome' do
accept_alert { find('.btn-remove').click }
end
end
step "I should not see branch 'improve/awesome'" do
expect(page).to have_css('.js-branch-improve\\/awesome', visible: :hidden)
end
def select_branch(branch_name)
find('.git-revision-dropdown-toggle').click
......
......@@ -67,10 +67,11 @@
expect(page).to have_content('fix')
expect(find('.all-branches')).to have_selector('li', count: 1)
accept_confirm { find('.js-branch-fix .btn-remove').click }
expect(page).not_to have_content('fix')
expect(find('.all-branches')).to have_selector('li', count: 0)
delete_branch
wait_for_requests
expect(all('li .ref-name', text: 'fix').count).to eq 0
end
end
end
......@@ -110,4 +111,13 @@ def sorted_branches(repository, count:, sort_by:)
Regexp.new(sorted_branches.join('.*'))
end
def delete_branch
find('#delete-branch-modal.modal', visible: false) # wait for Vue component to be loaded
find(".js-delete-branch").click
page.within '#delete-branch-modal' do
click_on 'Delete branch'
end
end
end
require 'spec_helper'
feature 'Environment' do
feature 'Environment', :js do
given(:project) { create(:project) }
given(:user) { create(:user) }
given(:role) { :developer }
......@@ -237,7 +237,7 @@
visit project_branches_path(project, search: 'feature')
remove_branch_with_hooks(project, user, 'feature') do
page.within('.js-branch-feature') { find('a.btn-remove').click }
page.within('.js-branch-feature') { find('button.btn-remove').click }
end
visit_environment(environment)
......
......@@ -48,11 +48,8 @@
expect(page).to have_content('fix')
expect(find('.all-branches')).to have_selector('li', count: 1)
page.find('[data-target="#modal-delete-branch"]').click
expect(page).to have_css('.js-delete-branch[disabled]')
fill_in 'delete_branch_input', with: 'fix'
click_link 'Delete protected branch'
delete_protected_branch
wait_for_requests
fill_in 'branch-search', with: 'fix'
find('#branch-search').native.send_keys(:enter)
......@@ -175,4 +172,14 @@ def set_protected_branch_name(branch_name)
find(".dropdown-input-field").set(branch_name)
click_on("Create wildcard #{branch_name}")
end
def delete_protected_branch
find('#delete-branch-modal.modal', visible: false) # wait for Vue component to be loaded
find(".js-delete-branch").click
page.within '#delete-branch-modal' do
fill_in 'delete-branch-modal-input', with: 'fix'
click_on 'Delete protected branch'
end
end
end
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать