Commit 6caae0d6 authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho Committed by Ramya Authappan

Replace end-to-end test by rspec test

parent c86f7802
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Issue weight' do
describe 'Issue weight', :js do
let(:project) { create(:project, :public) }
it 'shows weight on issue list row' do
......@@ -16,7 +16,7 @@ describe 'Issue weight' do
end
end
it 'allows user to update weight', :js do
it 'allows user to update weight from none to something' do
user = create(:user)
issue = create(:issue, author: user, project: project)
......@@ -37,4 +37,46 @@ describe 'Issue weight' do
end
end
end
it 'allows user to update weight from one value to another' do
user = create(:user)
issue = create(:issue, author: user, project: project, weight: 2)
project.add_developer(user)
sign_in(user)
visit project_issue_path(project, issue)
page.within('.weight') do
expect(page).to have_content "2"
click_link 'Edit'
find('.block.weight input').send_keys 3, :enter
page.within('.value') do
expect(page).to have_content "3"
end
end
end
it 'allows user to remove weight' do
user = create(:user)
issue = create(:issue, author: user, project: project, weight: 5)
project.add_developer(user)
sign_in(user)
visit project_issue_path(project, issue)
page.within('.weight') do
expect(page).to have_content "5"
click_link 'remove weight'
page.within('.value') do
expect(page).to have_content "None"
end
end
end
end
# frozen_string_literal: true
module QA
# https://gitlab.com/gitlab-org/gitlab/issues/33549
context 'Plan', :quarantine do
describe 'Issues weight CRUD operations' do
let(:issue) do
Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'issue-to-test-weight-crud-operations'
end
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
end
it 'adds, edits, and removes issue\'s weight' do
issue.visit!
weight_of_one = 1
weight_of_two = 2
Page::Project::Issue::Show.perform do |show|
show.set_weight(weight_of_one)
expect(show.weight_label_value).to have_content(weight_of_one)
show.set_weight(weight_of_two)
expect(show.weight_label_value).to have_content(weight_of_two)
show.click_remove_weight_link
expect(show.weight_no_value_content).to be_visible
expect(show.weight_no_value_content).to have_content('None')
end
end
end
end
end
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