Commit f684de50 authored by Jennifer Louie's avatar Jennifer Louie Committed by Walmyr Lima e Silva Filho

Add retries to performance_bar_spec E2E test assertion methods

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