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

Merge branch 'fix-performance-bar-spec' into 'master'

Add retries to performance_bar_spec E2E test assertion methods

See merge request gitlab-org/gitlab!22062
parents 720f7648 f684de50
......@@ -59,7 +59,8 @@ export default {
<div
v-if="currentRequest.details && metricDetails"
:id="`peek-view-${metric}`"
class="view qa-performance-bar-detailed-metric"
class="view"
data-qa-selector="detailed_metric_content"
>
<button
:data-target="`#modal-peek-${metric}-details`"
......
......@@ -107,7 +107,11 @@ export default {
</script>
<template>
<div id="js-peek" :class="env">
<div v-if="currentRequest" class="d-flex container-fluid container-limited qa-performance-bar">
<div
v-if="currentRequest"
class="d-flex container-fluid container-limited"
data-qa-selector="performance_bar"
>
<div id="peek-view-host" class="view">
<span
v-if="hasHost"
......
......@@ -45,13 +45,13 @@ export default {
};
</script>
<template>
<div id="peek-request-selector">
<div id="peek-request-selector" data-qa-selector="request_dropdown">
<select v-model="currentRequestId">
<option
v-for="request in requests"
:key="request.id"
:value="request.id"
class="qa-performance-bar-request"
data-qa-selector="request_dropdown_option"
>
{{ request.truncatedUrl }}
<span v-if="request.hasWarnings">(!)</span>
......
......@@ -9,11 +9,12 @@ module QA
end
view 'app/assets/javascripts/performance_bar/components/detailed_metric.vue' do
element :performance_bar_detailed_metric
element :detailed_metric_content
end
view 'app/assets/javascripts/performance_bar/components/request_selector.vue' do
element :performance_bar_request
element :request_dropdown_option
element :request_dropdown
end
def has_performance_bar?
......@@ -21,13 +22,18 @@ module QA
end
def has_detailed_metrics?
all_elements(:performance_bar_detailed_metric).all? do |metric|
retry_until(sleep_interval: 1) do
all_elements(:detailed_metric_content).all? do |metric|
metric.has_text?(%r{\d+})
end
end
end
def has_request_for?(path)
has_element?(:performance_bar_request, text: path)
click_element(:request_dropdown)
retry_until(sleep_interval: 1) do
has_element?(:request_dropdown_option, text: path)
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