diff --git a/CHANGELOG.md b/CHANGELOG.md index 41b130098..6c1fd50c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ * Add link to bugzilla tracker on Flaw form (`OSIDB-2897`) * Set public date to current date on unembargo (`OSIDB-2829`) * Add CVSSv3 score explanation input field (`OSIDB-2913`) +* Remove checkbox on IssueQueue (`OSIDB-2488`) ### Changed * Switch Flaw.component to Flaw.components (`OSIDB-2777`) diff --git a/features/flaw_list.feature b/features/flaw_list.feature index f4bf32811..90bcff40c 100644 --- a/features/flaw_list.feature +++ b/features/flaw_list.feature @@ -9,19 +9,19 @@ Feature: Flaw list testing When I click the link of a flaw Then I am able to view the flaw detail - Scenario: All flaws are selected when check-all checkbox is checked - When I check the check-all checkbox of flaw table - Then All flaws in flaw table are selected - - Scenario: All flaws are unselected when check-all checkbox is unchecked - Given The check-all checkbox of flaw list is checked - When I uncheck the check-all checkbox - Then No flaw in flaw table is selected - - @skip - Scenario: Bulk assign flaws to me - When I select some flaws from flaw list and click 'Assign to Me' - Then The owner of selected flaws is updated to me +# Scenario: All flaws are selected when check-all checkbox is checked +# When I check the check-all checkbox of flaw table +# Then All flaws in flaw table are selected +# +# Scenario: All flaws are unselected when check-all checkbox is unchecked +# Given The check-all checkbox of flaw list is checked +# When I uncheck the check-all checkbox +# Then No flaw in flaw table is selected +# +# @skip +# Scenario: Bulk assign flaws to me +# When I select some flaws from flaw list and click 'Assign to Me' +# Then The owner of selected flaws is updated to me Scenario: Sort flaw list on home page When I click the field header of flaw list table diff --git a/features/pages/advanced_search_page.py b/features/pages/advanced_search_page.py index 6d7ced4d8..e6c729c3b 100644 --- a/features/pages/advanced_search_page.py +++ b/features/pages/advanced_search_page.py @@ -23,12 +23,12 @@ def __init__(self, driver): "inputTextWindow": ("XPATH", "//details/form/div/input[@class='form-control']"), "selectKeyList2": ("XPATH", "(//select[@class='form-select search-facet-field'])[2]"), "selectValueList2": ("XPATH", "(//select[@class='form-select'])[2]"), - "cve_idText": ("XPATH", "//tr[1]/td[2]/a"), - "impactText": ("XPATH", "//tr[1]/td[3]"), - "sourceText": ("XPATH", "//tr[1]/td[4]"), - "titleText": ("XPATH", "//tr[1]/td[6]"), - "workflow_stateText": ("XPATH", "//tr[1]/td[7]"), - "ownerText": ("XPATH", "//tr[1]/td[8]"), + "cve_idText": ("XPATH", "//tr[1]/td[1]/a"), + "impactText": ("XPATH", "//tr[1]/td[2]"), + # "sourceText": ("XPATH", "//tr[1]/td[3]"), # TODO remove unused + "titleText": ("XPATH", "//tr[1]/td[4]"), + "workflow_stateText": ("XPATH", "//tr[1]/td[5]"), + "ownerText": ("XPATH", "//tr[1]/td[6]"), "closeKeysetBtn": ("XPATH", "//button[@class='osim-toast-close-btn btn-close']"), "closeSelBtn": ("XPATH", "//i[@class='bi-x']"), "embargoedFlag": ("XPATH", "(//span[contains(text(), 'Embargoed')])[1]"), diff --git a/features/pages/home_page.py b/features/pages/home_page.py index e1c29b2bd..7a9bdcf3c 100644 --- a/features/pages/home_page.py +++ b/features/pages/home_page.py @@ -23,21 +23,21 @@ def __init__(self, driver): "flawCheckBox": ("CSS", "input[class='form-check-input']"), "loadMoreFlawsBtn": ("XPATH", "//button[contains(text(), 'Load More Flaws')]"), "firstFlaw": ("XPATH", "//div[@class='osim-incident-list']/table/tbody/tr[1]"), - "firstFlawLink": ("XPATH", '//tbody[@class="table-group-divider"]/tr[1]/td[2]/a'), + "firstFlawLink": ("XPATH", '//tbody[@class="table-group-divider"]/tr[1]/td[1]/a'), "settingsBtn": ("LINK_TEXT", "Settings"), "flawIndexBtn": ("CSS", "ul[class='navbar-nav me-auto align-items-center'] li:nth-child(1) a"), "flawFilterBox": ("CSS", "input[placeholder='Filter Issues/Flaws']"), "advancedSearchDropDownBtn": ("XPATH", '//form[@role="search"]/div/button[2]'), "advancedSearchBtn": ("XPATH", "//a[contains(text(), 'Advanced Search')]"), - "cve_idText": ("XPATH", "//tr[3]/td[2]/a"), + "cve_idText": ("XPATH", "//tr[3]/td[1]/a"), "quickSearchBox": ("XPATH", "//form[@role='search']/div/input"), "quickSearchBtn": ("XPATH", "//form[@role='search']/div/button"), "myIssuesCheckbox": ("XPATH", "(//input[@class='d-inline-block form-check-input'])[1]"), "openIssuesCheckbox": ("XPATH", "(//input[@class='d-inline-block form-check-input'])[2]"), "defaultFilterCheckbox": ("XPATH", "(//input[@class='d-inline-block form-check-input'])[3]"), - "ownerText": ("XPATH", "//tr[1]/td[7]"), - "bulkActionBtn": ("XPATH", "//button[contains(text(), 'Bulk Action')]"), - "assignToMeBtn": ("XPATH", "//a[contains(text(), 'Assign to Me')]"), + "ownerText": ("XPATH", "//tr[1]/td[6]"), + # "bulkActionBtn": ("XPATH", "//button[contains(text(), 'Bulk Action')]"), # TODO remove unused + # "assignToMeBtn": ("XPATH", "//a[contains(text(), 'Assign to Me')]"), # TODO remove unused "flawSavedMsg": ("XPATH", "//div[text()='Flaw saved']"), "idBtn": ("XPATH", "//thead[@class='sticky-top']/tr/th[contains(text(), 'ID')]"), "impactBtn": ("XPATH", "//thead[@class='sticky-top']/tr/th[contains(text(), 'Impact')]"), @@ -58,21 +58,21 @@ def flaw_list_exist(self): def first_flaw_exist(self): self.firstFlaw.visibility_of_element_located() - def click_flaw_check_all_checkbox(self): - self.firstFlaw.visibility_of_element_located() - self.flawCheckAllCheckBox.click_button() - - def check_is_all_flaw_selected(self): - flaw_rows = find_elements_in_page_factory(self, "flawRow") - flaw_checkboxes = find_elements_in_page_factory(self, "flawCheckBox") - assert len(flaw_rows) + 1 == len(flaw_checkboxes), 'Incorrect checkbox count' - flaw_checked = [c for c in flaw_checkboxes if c.get_attribute('checked') == 'true'] - assert len(flaw_checked) == len(flaw_checkboxes), 'Incorrect check-all check result' - - def check_is_all_flaw_unselected(self): - flaw_checkboxes = find_elements_in_page_factory(self, "flawCheckBox") - flaw_checked = [c for c in flaw_checkboxes if c.get_attribute('checked') == 'true'] - assert len(flaw_checked) == 0, 'Incorrect check-all uncheck result' +# def click_flaw_check_all_checkbox(self): +# self.firstFlaw.visibility_of_element_located() +# self.flawCheckAllCheckBox.click_button() +# +# def check_is_all_flaw_selected(self): +# flaw_rows = find_elements_in_page_factory(self, "flawRow") +# flaw_checkboxes = find_elements_in_page_factory(self, "flawCheckBox") +# assert len(flaw_rows) + 1 == len(flaw_checkboxes), 'Incorrect checkbox count' +# flaw_checked = [c for c in flaw_checkboxes if c.get_attribute('checked') == 'true'] +# assert len(flaw_checked) == len(flaw_checkboxes), 'Incorrect check-all check result' +# +# def check_is_all_flaw_unselected(self): +# flaw_checkboxes = find_elements_in_page_factory(self, "flawCheckBox") +# flaw_checked = [c for c in flaw_checkboxes if c.get_attribute('checked') == 'true'] +# assert len(flaw_checked) == 0, 'Incorrect check-all uncheck result' def check_is_all_flaw_loaded(self): self.firstFlaw.visibility_of_element_located() @@ -112,34 +112,34 @@ def clear_box(self, field): self.driver.execute_script("arguments[0].scrollIntoView(true);", field_input) field_input.send_keys(Keys.CONTROL + 'a', Keys.BACKSPACE) - def select_bulk_flaws(self, length=1): - self.firstFlaw.visibility_of_element_located() - flaw_checkboxes = find_elements_in_page_factory(self, "flawCheckBox") - links = [] - for i in range(1, length+1): - checkbox = flaw_checkboxes[i] - checkbox.click() - flaw_link = self.driver.find_element( - By.XPATH, f"(//td[contains(@class, 'osim-issue-title')])[{i}]/a") - links.append(flaw_link) - return links - - def bulk_assign(self): - self.click_btn('bulkActionBtn') - hide = self.driver.find_elements( - locate_with(By.XPATH, "//div[@class='osim-incident-list']/table/thead"))[0] - self.driver.execute_script("arguments[0].style.visibility='hidden'", hide) - self.click_btn('assignToMeBtn') - self.driver.execute_script("arguments[0].style.visibility='visible'", hide) - - def check_bulk_assign(self, flaw_link): - from features.utils import wait_for_visibility_by_locator - flaw_link.click() - wait_for_visibility_by_locator(self.driver, By.XPATH, '//button[text()=" Save Changes "]') - assignee_value_element = self.driver.find_elements( - locate_with(By.XPATH, ("(//span[@class='osim-editable-text-value form-control'])[6]")))[0] - login_user = self.userBtn.get_text() - assert assignee_value_element.get_text() == login_user.strip(), 'Bulk assign failed' +# def select_bulk_flaws(self, length=1): +# self.firstFlaw.visibility_of_element_located() +# flaw_checkboxes = find_elements_in_page_factory(self, "flawCheckBox") +# links = [] +# for i in range(1, length+1): +# checkbox = flaw_checkboxes[i] +# checkbox.click() +# flaw_link = self.driver.find_element( +# By.XPATH, f"(//td[contains(@class, 'osim-issue-title')])[{i}]/a") +# links.append(flaw_link) +# return links +# +# def bulk_assign(self): +# self.click_btn('bulkActionBtn') +# hide = self.driver.find_elements( +# locate_with(By.XPATH, "//div[@class='osim-incident-list']/table/thead"))[0] +# self.driver.execute_script("arguments[0].style.visibility='hidden'", hide) +# self.click_btn('assignToMeBtn') +# self.driver.execute_script("arguments[0].style.visibility='visible'", hide) +# +# def check_bulk_assign(self, flaw_link): +# from features.utils import wait_for_visibility_by_locator +# flaw_link.click() +# wait_for_visibility_by_locator(self.driver, By.XPATH, '//button[text()=" Save Changes "]') +# assignee_value_element = self.driver.find_elements( +# locate_with(By.XPATH, ("(//span[@class='osim-editable-text-value form-control'])[6]")))[0] +# login_user = self.userBtn.get_text() +# assert assignee_value_element.get_text() == login_user.strip(), 'Bulk assign failed' def get_sort_flaws(self, field, sort_fields): sorted_numbers = sorted(random.sample(range(1, 50), 3)) diff --git a/features/steps/flaw_list.py b/features/steps/flaw_list.py index d3812280e..f042b6864 100644 --- a/features/steps/flaw_list.py +++ b/features/steps/flaw_list.py @@ -38,42 +38,43 @@ def step_impl(context): home_page.check_is_all_flaw_selected() -@given('The check-all checkbox of flaw list is checked') -def step_impl(context): - context.execute_steps(u""" - When I check the check-all checkbox of flaw table - """) - - -@when('I uncheck the check-all checkbox') -def step_impl(context): - home_page = HomePage(context.browser) - home_page.click_flaw_check_all_checkbox() - - -@then('No flaw in flaw table is selected') -def step_impl(context): - home_page = HomePage(context.browser) - home_page.check_is_all_flaw_unselected() - - -@when("I select some flaws from flaw list and click 'Assign to Me'") -def step_impl(context): - home_page = HomePage(context.browser) - # 1. Wait for loading flaw list and select flaws to bulk assign - context.links = home_page.select_bulk_flaws() - # 2. Click bulck action and assign to me buttons - home_page.bulk_assign() - # 3. Wait message "Flaw saved" - # The current bulk assign is not actually bulk update, thus - # there will be a 'Flaw saved' message for each selected flaw. - home_page.wait_msg('flawSavedMsg') - - -@then("The owner of selected flaws is updated to me") -def step_impl(context): - home_page = HomePage(context.browser) - home_page.check_bulk_assign(context.links[0]) +# @given('The check-all checkbox of flaw list is checked') +# def step_impl(context): +# context.execute_steps(u""" +# When I check the check-all checkbox of flaw table +# """) +# +# +# @when('I uncheck the check-all checkbox') +# def step_impl(context): +# home_page = HomePage(context.browser) +# home_page.click_flaw_check_all_checkbox() +# +# +# @then('No flaw in flaw table is selected') +# def step_impl(context): +# home_page = HomePage(context.browser) +# home_page.check_is_all_flaw_unselected() +# context.browser.quit() +# +# +# @when("I select some flaws from flaw list and click 'Assign to Me'") +# def step_impl(context): +# home_page = HomePage(context.browser) +# # 1. Wait for loading flaw list and select flaws to bulk assign +# context.links = home_page.select_bulk_flaws() +# # 2. Click bulck action and assign to me buttons +# home_page.bulk_assign() +# # 3. Wait message "Flaw saved" +# # The current bulk assign is not actually bulk update, thus +# # there will be a 'Flaw saved' message for each selected flaw. +# home_page.wait_msg('flawSavedMsg') +# +# +# @then("The owner of selected flaws is updated to me") +# def step_impl(context): +# home_page = HomePage(context.browser) +# home_page.check_bulk_assign(context.links[0]) @when("I click the field header of flaw list table") diff --git a/src/components/IssueQueue.vue b/src/components/IssueQueue.vue index 2bc2b885b..b16f78e69 100644 --- a/src/components/IssueQueue.vue +++ b/src/components/IssueQueue.vue @@ -2,9 +2,9 @@ import { computed, onMounted, reactive, ref, onUnmounted, watch } from 'vue'; import { DateTime } from 'luxon'; import IssueQueueItem from '@/components/IssueQueueItem.vue'; -import LabelCheckbox from './widgets/LabelCheckbox.vue'; +import LabelCheckbox from '@/components/widgets/LabelCheckbox.vue'; import { useUserStore } from '@/stores/UserStore'; -import { FlawClassificationStateEnum } from '../generated-client'; +import { FlawClassificationStateEnum } from '@/generated-client'; const userStore = useUserStore(); const emit = defineEmits(['flaws:fetch', 'flaws:load-more']); @@ -83,29 +83,12 @@ const relevantIssues = computed(() => { .map((issue) => reactive({ issue, selected: false })); }); -function updateSelectAll(selectedAll: boolean) { - for (const filteredIssue of relevantIssues.value) { - filteredIssue.selected = selectedAll; - } -} - function selectSortField(field: ColumnField) { isSortedByAscending.value = selectedSortField.value === field ? !isSortedByAscending.value : false; selectedSortField.value = field; } -const isSelectAllIndeterminate = computed(() => { - if (relevantIssues.value.length === 0) { - return false; - } - return relevantIssues.value.some((it) => it.selected !== relevantIssues.value[0].selected); -}); - -const isSelectAllChecked = computed(() => { - return relevantIssues.value.every((it) => it.selected); -}); - function relevantFields(issue: any) { return { id: issue.cve_id || issue.uuid, @@ -217,16 +200,6 @@ const nameForOption = (fieldName: string) => { - - - {