Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion end_to_end_tests/resources/general_keywords/navigation.robot
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,28 @@ Open history page of series
Should be equal as Strings ${url} ${str}
Wait Until Element is Enabled ${lastRunInfo}

Open history page of series with url params
[Arguments] ${series} ${offset} ${numberofbuilds}
${str}= Catenate SEPARATOR= ${history_url} ${series} /history ?offset= ${offset} &numberofbuilds= ${numberofbuilds}
Current Page Is url=${str}
${url}= Get Location
Set Suite Variable ${navigated_series} ${series}
Should be equal as Strings ${url} ${str}
Wait Until Element is Enabled ${lastRunInfo}


Open history page of series with checkbox set
[Arguments] ${series} ${boolean}
${str}= Catenate SEPARATOR= ${history_url} ${series} /history ?tag= ${boolean}
Current Page Is url=${str}
${url}= Get Location
Set Suite Variable ${navigated_series} ${series}
Should be equal as Strings ${url} ${str}
Wait Until Element is Enabled ${lastRunInfo}

Open overview page of series
[Arguments] ${series}
${str}= Catenate SEPARATOR= ${history_url} ${series} /overview
${str}= Catenate SEPARATOR= ${history_url} ${series} /overview
Current Page Is url=${str}
${url}= Get Location
Set Suite Variable ${navigated_series} ${series}
Expand Down
7 changes: 6 additions & 1 deletion end_to_end_tests/resources/page_locators/history_page.robot
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ ${series_history_third_recent} //*[@id="history-table-head"]/tr/th[5]/a
${enabled_offset_right} xpath://*[contains(@class, 'rightfalse')]
${enabled_offset_left} xpath://*[contains(@class, 'leftfalse')]
${disabled_offset_right} xpath://*[contains(@class, 'rightrue')]
${disabled_offset_left} xpath://*[contains(@class, 'leftrue')]
${disabled_offset_left} xpath://*[contains(@class, 'leftrue')]


${clicked_pass} xpath://*[contains(@class, 'passtrue')]

${clicked_fail} xpath://*[contains(@class, 'failtrue')]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
***Keywords***

Table should be limited to
[Arguments] ${number}
Wait Until Element Is Enabled ${table_header_xpath}
${elements} = Get Element Count ${table_header_xpath}
${sum} = Evaluate ${number} + 2
Should be True ${sum}>=${elements}

Set Offset field to
[Arguments] ${text}
Input Text ${offset_field} ${text}

Left Button Should be disabled
Wait Until Element Is Visible ${offset_left}
${count}= Get Element Count ${disabled_offset_left}
Should be equal as Integers ${count} 0

Left Button Should be enabled
Wait Until Element Is Enabled ${offset_left}
${count}= Get Element Count ${enabled_offset_left}
Should be equal as Integers ${count} 1

Right Button Should be enabled
Wait Until Element Is Enabled ${offset_right}
${count}= Get Element Count ${enabled_offset_right}
Should be equal as Integers ${count} 1

Right Button Should be disabled
Wait Until Element Is Visible ${offset_right}
${count}= Get Element Count ${disabled_offset_right}
Should be equal as Integers ${count} 0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
***Settings***

Resource ../../../resources/resource.robot

Resource ./history_keywords.robot
*** Test Cases ***

Test Build Amount Dropdown
Expand Down Expand Up @@ -39,8 +39,6 @@ Test Offset Functionality
Offset should be 0
Most Recent Build Number should be ${most_recent_build}

#Test Offset Functionality with Offset URL, to be added

*** Keywords ***

Select From Dropdown
Expand All @@ -57,13 +55,6 @@ Browser is on a history page of series
${url}= Get Location
Should be equal as Strings ${url} ${str}

Table should be limited to
[Arguments] ${number}
Wait Until Element Is Enabled ${table_header_xpath}
${elements} = Get Element Count ${table_header_xpath}
${sum} = Evaluate ${number} + 2
Should be True ${sum}>=${elements}

Store Most Recent Builds
Wait Until Element Is Enabled ${series_history_most_recent}
${temp_most_recent}= Get Text ${series_history_most_recent}
Expand All @@ -81,10 +72,6 @@ Most Recent Build Number should be

Should be equal as Strings ${build} ${temp_most_recent}

Set Offset field to
[Arguments] ${text}
Input Text ${offset_field} ${text}

Offset should be
[Arguments] ${value}
${url}= Get Location
Expand All @@ -96,26 +83,6 @@ Check offset url
${full_string}= Catenate SEPARATOR= offset = ${value}
Should Contain ${url} ${full_string}

Left Button Should be disabled
Wait Until Element Is Visible ${offset_left}
${count}= Get Element Count ${disabled_offset_left}
Should be equal as Integers ${count} 0

Left Button Should be enabled
Wait Until Element Is Enabled ${offset_left}
${count}= Get Element Count ${enabled_offset_left}
Should be equal as Integers ${count} 1

Right Button Should be enabled
Wait Until Element Is Enabled ${offset_right}
${count}= Get Element Count ${enabled_offset_right}
Should be equal as Integers ${count} 1

Right Button Should be disabled
Wait Until Element Is Visible ${offset_right}
${count}= Get Element Count ${disabled_offset_right}
Should be equal as Integers ${count} 0

Click Right Button
Click Element ${offset_right}
Click Left Button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,53 @@
***Settings***

Resource ../../../resources/resource.robot
Resource ./history_keywords.robot

***Test Cases***

Test Url Navigation
Current Page Is url=${URL}
Wait Until Page Contains Epimetheus
Wait Until Element Contains ${HELP_PAGE_WELCOME_ELEMENT} Welcome
Click Element ${NAV_TEAM}
Click Element ${NAV_TEAM}

Test Series History Url Navigation With Offset Parameters
Open history page of series with url params 3 0 5
Table should be limited to number=5
Left Button Should be disabled

Open history page of series with url params 3 1 10
Table should be limited to number=10
Left Button Should be enabled
Set Offset field to 1
Left Button Should be enabled
Set Offset field to 2
Left Button Should be disabled

Open history page of series with url params 3 2 15
Table should be limited to number=15
Left Button Should be enabled
Set Offset field to 2
Left Button Should be enabled
Set Offset field to 3
Left Button Should be disabled

Test Series History Url Navigation With Failing
Open history page of series with checkbox set 3 Passing
Checkbox is ticked for Passing

Open history page of series with checkbox set 3 Failing
Checkbox is ticked for Failing


***Keywords***

Checkbox is ticked for
[Arguments] ${status}
Wait Until Element Is Enabled ${fail_checkbox_locator}
${path}= Set Variable If '${status}' == 'Passing' ${clicked_pass} ${clicked_fail}
Log ${status} Warn
Log ${path} Warn
${count}= Get Element Count ${path}
Should be Equal As Numbers ${count} 1

2 changes: 1 addition & 1 deletion frontend/src/components/buildTable/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Table = ({ id }) => {
{t('build.table.status')}
</th>
<th>{t('build.table.test')}</th>
<th>{t('build.table.suite')}</th>
<th>{t('build.table.error')}</th>
<th className="test-time-row">
{t('build.table.time')}
</th>
Expand Down
18 changes: 16 additions & 2 deletions frontend/src/components/buttons/LastRunCheckbox.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// eslint-disable-next-line
import React, { useState } from 'react';
/* eslint-disable react-hooks/exhaustive-deps */

import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useStateValue } from '../../contexts/state';
import { ReactComponent as Checked } from '../../images/checked.svg';
Expand Down Expand Up @@ -27,6 +29,16 @@ const Checkbox = ({ direction }) => {
const location = useLocation();
const queryParams = useQueryParams();

useEffect(() => {
const tags = queryParams.getAll('tag') || 'Passing';
if (tags.includes('Passing')) {
setPassFilter(true);
}
if (tags.includes('Failing')) {
setFailFilter(true);
}
}, []);

const updateTags = tag => {
let tagList = queryParams.getAll('tag');
tagList.indexOf(tag) !== -1
Expand Down Expand Up @@ -76,7 +88,8 @@ const Checkbox = ({ direction }) => {
type="checkbox"
name="filterPassed"
value="PASS"
checked={lastRunFilterPass.isChecked}
className={`pass${passFilter}`}
checked={passFilter}
onChange={e => handlePassFilterChange(e)}
/>
<span>{passFilter ? <Checked /> : <Unchecked />}</span>
Expand All @@ -88,6 +101,7 @@ const Checkbox = ({ direction }) => {
name="filterFailed"
value="FAIL"
checked={failFilter}
className={`fail${failFilter}`}
onChange={e => handleFailFilterChange(e)}
/>
<span>{failFilter ? <Checked /> : <Unchecked />}</span>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/locales/en/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"suite": "Suitename",
"status": "Status",
"test": "Test(s)",
"error": "Error messages",
"error": "Error message",
"time": "Time",
"flakiness": "Flakiness",
"row": {
Expand Down