Commit 94968250 authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho

Merge branch 'qa/add-edit-delete-issue-weight-e2e-test' into 'master'

Add end-to-end test for issue weight CRUD operations

Closes gitlab-org/quality/testcases#227

See merge request gitlab-org/gitlab!16645
parents 3b80418b 45c30790
......@@ -165,6 +165,7 @@ export default {
<a
v-if="editable"
class="float-right js-weight-edit-link"
data-qa-selector="edit_weight_link"
href="#"
@click="onEditClick(!shouldShowEditField)"
>{{ __('Edit') }}</a
......@@ -175,6 +176,7 @@ export default {
ref="editableField"
:value="weight"
class="form-control"
data-qa-selector="weight_input_field"
type="text"
:placeholder="__('Enter a number')"
@blur="onSubmit"
......@@ -192,12 +194,18 @@ export default {
}}</strong>
<span v-if="editable">
-
<a class="btn-default-hover-link js-weight-remove-link" href="#" @click="removeWeight">{{
__('remove weight')
}}</a>
<a
class="btn-default-hover-link js-weight-remove-link"
data-qa-selector="remove_weight_link"
href="#"
@click="removeWeight"
>{{ __('remove weight') }}</a
>
</span>
</span>
<span v-else class="no-value">{{ noValueLabel }}</span>
<span v-else class="no-value" data-qa-selector="weight_no_value_content">{{
noValueLabel
}}</span>
</div>
</div>
</template>
......@@ -14,10 +14,24 @@ module QA
view 'ee/app/assets/javascripts/sidebar/components/weight/weight.vue' do
element :weight_label_value
element :edit_weight_link
element :remove_weight_link
element :weight_input_field
element :weight_no_value_content
end
end
end
def click_remove_weight_link
click_element(:remove_weight_link)
end
def set_weight(weight)
click_element(:edit_weight_link)
fill_element(:weight_input_field, weight)
send_keys_to_element(:weight_input_field, :enter)
end
def wait_for_related_issues_to_load
wait(reload: false) do
has_no_element?(:related_issues_loading_icon)
......@@ -27,6 +41,10 @@ module QA
def weight_label_value
find_element(:weight_label_value)
end
def weight_no_value_content
find_element(:weight_no_value_content)
end
end
end
end
......
# frozen_string_literal: true
module QA
context 'Plan' 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
......@@ -2,7 +2,7 @@
module QA
context 'Plan' do
describe 'Issues weights' do
describe 'Issues weight visualization' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
......
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