From 9849509a2c6e6840d458bda4913144c572cfc73a Mon Sep 17 00:00:00 2001 From: AR-RIFAT Date: Wed, 11 Sep 2024 10:09:50 +1000 Subject: [PATCH 1/5] :white_check_mark: added tests for different tabs --- playwright/pages/base_page.py | 18 ++- playwright/pages/components/contact_area.py | 13 ++ playwright/pages/components/tab_container.py | 32 +++++ playwright/pages/components/tabs/__init__.py | 0 playwright/pages/components/tabs/about.py | 15 +++ playwright/pages/components/tabs/abstract.py | 12 ++ .../components/tabs/associated_records.py | 15 +++ playwright/pages/components/tabs/citation.py | 18 +++ .../pages/components/tabs/global_attr.py | 11 ++ playwright/pages/components/tabs/lineage.py | 11 ++ playwright/pages/components/tabs/links.py | 13 ++ .../pages/components/tabs/metadata_info.py | 21 +++ playwright/pages/detail_page.py | 35 +++++ playwright/settings.toml | 2 +- .../tests/detail_page/test_about_tab.py | 52 +++++++ .../test_associated_records_tab.py | 43 ++++++ .../tests/detail_page/test_citation_tab.py | 42 ++++++ .../tests/detail_page/test_detail_page.py | 127 ++++++++++++++++++ .../tests/detail_page/test_lineage_tab.py | 30 +++++ .../tests/detail_page/test_links_tab.py | 37 +++++ .../detail_page/test_metadata_info_tab.py | 42 ++++++ src/components/details/LinkCard.tsx | 1 + src/components/list/CollapseList.tsx | 9 +- src/components/list/MetadataContactList.tsx | 5 +- src/components/list/listItem/CollapseItem.tsx | 3 + .../list/listItem/subitem/ContactArea.tsx | 6 +- .../subpages/tab-panels/AboutPanel.tsx | 8 +- 27 files changed, 609 insertions(+), 12 deletions(-) create mode 100644 playwright/pages/components/contact_area.py create mode 100644 playwright/pages/components/tab_container.py create mode 100644 playwright/pages/components/tabs/__init__.py create mode 100644 playwright/pages/components/tabs/about.py create mode 100644 playwright/pages/components/tabs/abstract.py create mode 100644 playwright/pages/components/tabs/associated_records.py create mode 100644 playwright/pages/components/tabs/citation.py create mode 100644 playwright/pages/components/tabs/global_attr.py create mode 100644 playwright/pages/components/tabs/lineage.py create mode 100644 playwright/pages/components/tabs/links.py create mode 100644 playwright/pages/components/tabs/metadata_info.py create mode 100644 playwright/pages/detail_page.py create mode 100644 playwright/tests/detail_page/test_about_tab.py create mode 100644 playwright/tests/detail_page/test_associated_records_tab.py create mode 100644 playwright/tests/detail_page/test_citation_tab.py create mode 100644 playwright/tests/detail_page/test_detail_page.py create mode 100644 playwright/tests/detail_page/test_lineage_tab.py create mode 100644 playwright/tests/detail_page/test_links_tab.py create mode 100644 playwright/tests/detail_page/test_metadata_info_tab.py diff --git a/playwright/pages/base_page.py b/playwright/pages/base_page.py index 89ca6bc4..9fcf2d97 100644 --- a/playwright/pages/base_page.py +++ b/playwright/pages/base_page.py @@ -9,10 +9,18 @@ def get_button(self, text: str, exact: bool = True) -> Locator: """Return button element by text""" return self.page.get_by_role('button', name=text, exact=exact) + def click_button(self, text: str) -> None: + """Click on the given button""" + self.get_button(text).click() + def get_option(self, text: str, exact: bool = True) -> Locator: """Return option element by text""" return self.page.get_by_role('option', name=text, exact=exact) + def click_option(self, text: str) -> None: + """Click on the given option""" + self.get_option(text).click() + def get_label(self, text: str) -> Locator: """Return label element by text""" return self.page.get_by_label(text, exact=True) @@ -21,13 +29,13 @@ def click_label(self, text: str) -> None: """Click on the given label""" self.get_label(text).click() + def get_text(self, text: str) -> Locator: + """Return element by text""" + return self.page.get_by_text(text) + def click_text(self, text: str) -> None: """Click on the given text""" - self.page.get_by_text(text).click() - - def click_option(self, text: str) -> None: - """Click on the given option""" - self.get_option(text).click() + self.get_text(text).click() def get_tab(self, text: str) -> Locator: """Return tab element by text""" diff --git a/playwright/pages/components/contact_area.py b/playwright/pages/components/contact_area.py new file mode 100644 index 00000000..d4ba0b8a --- /dev/null +++ b/playwright/pages/components/contact_area.py @@ -0,0 +1,13 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage + + +class ContactAreaComponent(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.address = page.get_by_test_id('contact-address') + self.phone = page.get_by_test_id('contact-phone') + self.link = page.get_by_test_id('contact-link') diff --git a/playwright/pages/components/tab_container.py b/playwright/pages/components/tab_container.py new file mode 100644 index 00000000..cfeab309 --- /dev/null +++ b/playwright/pages/components/tab_container.py @@ -0,0 +1,32 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage +from pages.components.tabs.about import AboutTab +from pages.components.tabs.abstract import AbstractTab +from pages.components.tabs.associated_records import AssociatedRecordsTab +from pages.components.tabs.citation import CitationTab +from pages.components.tabs.global_attr import GlobalAttrTab +from pages.components.tabs.lineage import LineageTab +from pages.components.tabs.links import LinksTab +from pages.components.tabs.metadata_info import MetadataInfoTab + + +class TabContainerComponent(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.abstract = AbstractTab(page) + self.about = AboutTab(page) + self.links = LinksTab(page) + self.lineage = LineageTab(page) + self.metadata_info = MetadataInfoTab(page) + self.citation = CitationTab(page) + self.associated_records = AssociatedRecordsTab(page) + self.global_attr = GlobalAttrTab(page) + + def scroll_right(self) -> None: + self.page.get_by_test_id('KeyboardArrowRightIcon').click() + + def scroll_left(self) -> None: + self.page.get_by_test_id('KeyboardArrowLeftIcon').click() diff --git a/playwright/pages/components/tabs/__init__.py b/playwright/pages/components/tabs/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/playwright/pages/components/tabs/about.py b/playwright/pages/components/tabs/about.py new file mode 100644 index 00000000..759a54d3 --- /dev/null +++ b/playwright/pages/components/tabs/about.py @@ -0,0 +1,15 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage + + +class AboutTab(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.tab = self.get_tab('About') + # sections + self.contacts = self.get_button('Contacts') + self.credits = self.get_button('Credits') + self.keywords = self.get_button('Keywords') diff --git a/playwright/pages/components/tabs/abstract.py b/playwright/pages/components/tabs/abstract.py new file mode 100644 index 00000000..fc7d3038 --- /dev/null +++ b/playwright/pages/components/tabs/abstract.py @@ -0,0 +1,12 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage + + +class AbstractTab(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.tab = self.get_tab('Abstract') + self.map = page.get_by_label('Abstract').get_by_label('Map', exact=True) diff --git a/playwright/pages/components/tabs/associated_records.py b/playwright/pages/components/tabs/associated_records.py new file mode 100644 index 00000000..d91741cb --- /dev/null +++ b/playwright/pages/components/tabs/associated_records.py @@ -0,0 +1,15 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage + + +class AssociatedRecordsTab(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.tab = self.get_tab('Associated Records') + # sections + self.parent_record = self.get_button('Parent Record') + self.sibling_records = self.get_button('Sibling Records') + self.child_records = self.get_button('Child Records') diff --git a/playwright/pages/components/tabs/citation.py b/playwright/pages/components/tabs/citation.py new file mode 100644 index 00000000..5bdacef5 --- /dev/null +++ b/playwright/pages/components/tabs/citation.py @@ -0,0 +1,18 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage + + +class CitationTab(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.tab = self.get_tab('Citation') + # sections + self.cited_responsible_parties = self.get_button( + 'Cited Responsible Parties' + ) + self.license = self.get_button('License') + self.suggested_citation = self.get_button('Suggested Citation') + self.constranits = self.get_button('Constraints') diff --git a/playwright/pages/components/tabs/global_attr.py b/playwright/pages/components/tabs/global_attr.py new file mode 100644 index 00000000..85863461 --- /dev/null +++ b/playwright/pages/components/tabs/global_attr.py @@ -0,0 +1,11 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage + + +class GlobalAttrTab(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.tab = self.get_tab('Global Attribute') diff --git a/playwright/pages/components/tabs/lineage.py b/playwright/pages/components/tabs/lineage.py new file mode 100644 index 00000000..63f4f00e --- /dev/null +++ b/playwright/pages/components/tabs/lineage.py @@ -0,0 +1,11 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage + + +class LineageTab(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.tab = self.get_tab('Lineage') diff --git a/playwright/pages/components/tabs/links.py b/playwright/pages/components/tabs/links.py new file mode 100644 index 00000000..4231c81b --- /dev/null +++ b/playwright/pages/components/tabs/links.py @@ -0,0 +1,13 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage + + +class LinksTab(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.tab = self.get_tab('Links') + self.link_cards = page.get_by_test_id('links-card') + self.copy_link_button = self.get_button('Copy Link') diff --git a/playwright/pages/components/tabs/metadata_info.py b/playwright/pages/components/tabs/metadata_info.py new file mode 100644 index 00000000..17bf5cbe --- /dev/null +++ b/playwright/pages/components/tabs/metadata_info.py @@ -0,0 +1,21 @@ +from playwright.sync_api import Page + +from pages.base_page import BasePage + + +class MetadataInfoTab(BasePage): + def __init__(self, page: Page): + self.page = page + + # Page locators + self.tab = self.get_tab('Metadata Information') + # sections + self.metadata_contact = self.get_button('Metadata Contact') + self.metadata_identifier = self.get_button('Metadata Identifier') + self.full_metadata_link = self.get_button('Full Metadata Link') + self.metadata_dates = self.get_button('Metadata Dates') + + # other + self.meradata_contact_title = page.get_by_test_id( + 'metadata-contact-title' + ) diff --git a/playwright/pages/detail_page.py b/playwright/pages/detail_page.py new file mode 100644 index 00000000..e3a777e9 --- /dev/null +++ b/playwright/pages/detail_page.py @@ -0,0 +1,35 @@ +from playwright.sync_api import Locator, Page + +from config import settings +from pages.base_page import BasePage +from pages.components.contact_area import ContactAreaComponent +from pages.components.tab_container import TabContainerComponent + + +class DetailPage(BasePage): + def __init__(self, page: Page): + self.page = page + self.tabs = TabContainerComponent(page) + self.contact_area = ContactAreaComponent(page) + + # Page locators + self.page_title = self.get_label(text='collection title') + + def load(self, uuid: str) -> None: + url = f'{settings.baseURL}/details?uuid={uuid}' + self.page.goto(url, timeout=90 * 1000) + + def get_tab_section(self, title: str) -> Locator: + return self.page.get_by_test_id(f'detail-sub-section-{title}') + + def get_not_found_element(self, item: str) -> Locator: + return self.get_text(f'{item} Not Found') + + def get_collapse_list(self, item_list: str) -> Locator: + return self.page.get_by_test_id(f'collapse-list-{item_list.lower()}') + + def click_show_more(self, item_list: str) -> None: + self.click_button(f'Show More {item_list}') + + def click_show_less(self, item_list: str) -> None: + self.click_button(f'Show Less {item_list}') diff --git a/playwright/settings.toml b/playwright/settings.toml index a4c58125..b9900bf5 100644 --- a/playwright/settings.toml +++ b/playwright/settings.toml @@ -1,2 +1,2 @@ [development] -baseURL = "http://localhost:5173/" +baseURL = "http://localhost:5173" diff --git a/playwright/tests/detail_page/test_about_tab.py b/playwright/tests/detail_page/test_about_tab.py new file mode 100644 index 00000000..c66be4cb --- /dev/null +++ b/playwright/tests/detail_page/test_about_tab.py @@ -0,0 +1,52 @@ +import pytest +from playwright.sync_api import Page, expect + +from pages.detail_page import DetailPage + + +@pytest.mark.parametrize( + 'title, uuid, contact, credit, keyword, keyword_value', + [ + ( + 'Integrated Marine Observing System (IMOS) - Location of assets', + '1fba3a57-35f4-461b-8a0e-551af229714e', + 'Integrated Marine Observing System (IMOS)', + 'Integrated Marine Observing System (IMOS) is enabled by the National Collaborative Research Infrastructure Strategy', + 'IMOS Keywords Thesaurus', + 'IMOS Facility | Deep Water Moorings', + ), + ( + 'IMOS Bio-Acoustic Ships of Opportunity (BA SOOP) Sub-Facility', + '0015db7e-e684-7548-e053-08114f8cd4ad', + 'CSIRO Oceans & Atmosphere - Hobart - Downie, Ryan', + 'Credits Not Found', + 'AODN Geographic Extent Names', + 'Global / Oceans | Indian', + ), + ], +) +def test_about_sections( + page_mock: Page, + title: str, + uuid: str, + contact: str, + credit: str, + keyword: str, + keyword_value: str, +) -> None: + detail_page = DetailPage(page_mock) + + detail_page.load(uuid) + expect(detail_page.page_title).to_have_text(title) + about = detail_page.tabs.about + about.tab.click() + + about.keywords.click() + detail_page.click_button(keyword) + expect(detail_page.get_text(keyword_value)).to_be_in_viewport() + + about.credits.click() + expect(detail_page.get_text(credit)).to_be_in_viewport() + + about.contacts.click() + expect(detail_page.get_button(contact)).to_be_in_viewport() diff --git a/playwright/tests/detail_page/test_associated_records_tab.py b/playwright/tests/detail_page/test_associated_records_tab.py new file mode 100644 index 00000000..296acdc5 --- /dev/null +++ b/playwright/tests/detail_page/test_associated_records_tab.py @@ -0,0 +1,43 @@ +import pytest +from playwright.sync_api import Page, expect + +from pages.detail_page import DetailPage + + +@pytest.mark.parametrize( + 'title, uuid, parent_record, parent_record_value, sibling_records, sibling_records_value', + [ + ( + 'Integrated Marine Observing System (IMOS) - Location of assets', + '1fba3a57-35f4-461b-8a0e-551af229714e', + 'Integrated Marine Observing System (IMOS)', + 'IMOS is designed to be a fully-integrated, national system', + 'IMOS - New Technology Proving - Low Cost Wave Buoys', + 'The Low Cost Wave Buoy Technology Sub-Facility', + ), + ], +) +def test_associated_records_sections( + page_mock: Page, + title: str, + uuid: str, + parent_record: str, + parent_record_value: str, + sibling_records: str, + sibling_records_value: str, +) -> None: + detail_page = DetailPage(page_mock) + + detail_page.load(uuid) + expect(detail_page.page_title).to_have_text(title) + detail_page.tabs.scroll_right() + associated_records = detail_page.tabs.associated_records + associated_records.tab.click() + + associated_records.sibling_records.click() + detail_page.click_button(sibling_records) + expect(detail_page.get_text(sibling_records_value)).to_be_in_viewport() + + associated_records.parent_record.click() + detail_page.click_button(parent_record) + expect(detail_page.get_text(parent_record_value)).to_be_in_viewport() diff --git a/playwright/tests/detail_page/test_citation_tab.py b/playwright/tests/detail_page/test_citation_tab.py new file mode 100644 index 00000000..59cefbde --- /dev/null +++ b/playwright/tests/detail_page/test_citation_tab.py @@ -0,0 +1,42 @@ +import pytest +from playwright.sync_api import Page, expect + +from pages.detail_page import DetailPage + + +@pytest.mark.parametrize( + 'title, uuid, constranits_value, suggested_citation_value, license_value', + [ + ( + 'Integrated Marine Observing System (IMOS) - Location of assets', + '1fba3a57-35f4-461b-8a0e-551af229714e', + 'Use Limitation', + 'The citation in a list of references is: "IMOS [year-of-data-download]', + 'Creative Commons Attribution 4.0 International License', + ), + ], +) +def test_citation_sections( + page_mock: Page, + title: str, + uuid: str, + constranits_value: str, + suggested_citation_value: str, + license_value: str, +) -> None: + detail_page = DetailPage(page_mock) + + detail_page.load(uuid) + expect(detail_page.page_title).to_have_text(title) + detail_page.tabs.scroll_right() + citation = detail_page.tabs.citation + citation.tab.click() + + citation.constranits.click() + expect(detail_page.get_text(constranits_value)).to_be_in_viewport() + + citation.suggested_citation.click() + expect(detail_page.get_text(suggested_citation_value)).to_be_in_viewport() + + citation.license.click() + expect(detail_page.get_text(license_value)).to_be_in_viewport() diff --git a/playwright/tests/detail_page/test_detail_page.py b/playwright/tests/detail_page/test_detail_page.py new file mode 100644 index 00000000..94bc6c5f --- /dev/null +++ b/playwright/tests/detail_page/test_detail_page.py @@ -0,0 +1,127 @@ +import pytest +from playwright.sync_api import Page, expect + +from pages.detail_page import DetailPage +from pages.landing_page import LandingPage +from pages.search_page import SearchPage + + +@pytest.mark.parametrize( + 'title', + [ + ('Integrated Marine Observing System (IMOS) - Location of assets'), + ('IMOS Bio-Acoustic Ships of Opportunity (BA SOOP) Sub-Facility'), + ], +) +def test_tab_panel_scroll(page_mock: Page, title: str) -> None: + landing_page = LandingPage(page_mock) + search_page = SearchPage(page_mock) + detail_page = DetailPage(page_mock) + + landing_page.load() + landing_page.search.click_search_button() + page_mock.wait_for_timeout(2000) + search_page.click_dataset(title) + + expect(detail_page.page_title).to_have_text(title) + detail_page.tabs.scroll_right() + expect(detail_page.tabs.global_attr.tab).to_be_in_viewport() + detail_page.tabs.scroll_left() + expect(detail_page.tabs.abstract.tab).to_be_in_viewport() + + +@pytest.mark.parametrize( + 'title, uuid, tab, not_found_item', + [ + ( + 'Integrated Marine Observing System (IMOS) - Location of assets', + '1fba3a57-35f4-461b-8a0e-551af229714e', + 'Metadata Information', + 'Metadata Link', + ), + ( + 'IMOS Bio-Acoustic Ships of Opportunity (BA SOOP) Sub-Facility', + '0015db7e-e684-7548-e053-08114f8cd4ad', + 'About', + 'Credits', + ), + ], +) +def test_not_found_item( + page_mock: Page, title: str, uuid: str, tab: str, not_found_item: str +) -> None: + detail_page = DetailPage(page_mock) + + detail_page.load(uuid) + expect(detail_page.page_title).to_have_text(title) + + detail_page.click_tab(tab) + expect(detail_page.get_not_found_element(not_found_item)).to_be_visible() + + +@pytest.mark.parametrize( + 'title, uuid, tab, contact_button, address, phone, link', + [ + ( + 'Integrated Marine Observing System (IMOS) - Location of assets', + '1fba3a57-35f4-461b-8a0e-551af229714e', + 'About', + 'Integrated Marine Observing System (IMOS)', + 'Private Bag 110', + '61 3 6226 7488', + 'Website of the Australian Ocean Data Network (AODN)', + ) + ], +) +def test_contact_details( + page_mock: Page, + title: str, + uuid: str, + tab: str, + contact_button: str, + address: str, + phone: str, + link: str, +) -> None: + detail_page = DetailPage(page_mock) + + detail_page.load(uuid) + expect(detail_page.page_title).to_have_text(title) + + detail_page.click_tab(tab) + detail_page.click_button(contact_button) + + expect(detail_page.contact_area.address).to_contain_text(address) + expect(detail_page.contact_area.phone).to_contain_text(phone) + expect(detail_page.contact_area.link).to_contain_text(link) + + +@pytest.mark.parametrize( + 'title, uuid, tab, item_list', + [ + ( + 'IMOS Bio-Acoustic Ships of Opportunity (BA SOOP) Sub-Facility', + '0015db7e-e684-7548-e053-08114f8cd4ad', + 'About', + 'Keywords', + ), + ], +) +def test_show_more_and_less_list_items( + page_mock: Page, title: str, uuid: str, tab: str, item_list: str +) -> None: + detail_page = DetailPage(page_mock) + + detail_page.load(uuid) + expect(detail_page.page_title).to_have_text(title) + detail_page.click_tab(tab) + + keywords = detail_page.get_collapse_list(item_list) + initial_count = keywords.count() + + detail_page.click_show_more(item_list) + expect(keywords).not_to_have_count(initial_count) + assert keywords.count() > initial_count + + detail_page.click_show_less(item_list) + expect(keywords).to_have_count(initial_count) diff --git a/playwright/tests/detail_page/test_lineage_tab.py b/playwright/tests/detail_page/test_lineage_tab.py new file mode 100644 index 00000000..6299f134 --- /dev/null +++ b/playwright/tests/detail_page/test_lineage_tab.py @@ -0,0 +1,30 @@ +import pytest +from playwright.sync_api import Page, expect + +from pages.detail_page import DetailPage + + +@pytest.mark.parametrize( + 'title, uuid, content', + [ + ( + 'IMOS Bio-Acoustic Ships of Opportunity (BA SOOP) Sub-Facility', + '0015db7e-e684-7548-e053-08114f8cd4ad', + 'Vessels collect 38 kHz acoustic data from either Simrad EK60', + ), + ], +) +def test_lineage_sections( + page_mock: Page, + title: str, + uuid: str, + content: str, +) -> None: + detail_page = DetailPage(page_mock) + + detail_page.load(uuid) + expect(detail_page.page_title).to_have_text(title) + lineage = detail_page.tabs.lineage + lineage.tab.click() + + expect(detail_page.get_text(content)).to_be_visible() diff --git a/playwright/tests/detail_page/test_links_tab.py b/playwright/tests/detail_page/test_links_tab.py new file mode 100644 index 00000000..ff678782 --- /dev/null +++ b/playwright/tests/detail_page/test_links_tab.py @@ -0,0 +1,37 @@ +import pytest +from playwright.sync_api import Page, expect + +from pages.detail_page import DetailPage + + +@pytest.mark.parametrize( + 'title, uuid, link_title, link_href', + [ + ( + 'IMOS Bio-Acoustic Ships of Opportunity (BA SOOP) Sub-Facility', + '0015db7e-e684-7548-e053-08114f8cd4ad', + 'Data Link', + 'https://thredds.aodn.org.au/thredds/catalog/IMOS/SOOP/SOOP-BA/catalog.html', + ), + ], +) +def test_links_sections( + page_mock: Page, + title: str, + uuid: str, + link_title: str, + link_href: str, +) -> None: + detail_page = DetailPage(page_mock) + + detail_page.load(uuid) + expect(detail_page.page_title).to_have_text(title) + links = detail_page.tabs.links + links.tab.click() + + link_card = links.link_cards.first + link_card.hover() + expect(links.copy_link_button).to_be_visible() + + expect(link_card.get_by_text(link_title)).to_be_visible() + expect(link_card.get_by_role('link', name=link_href)).to_be_visible() diff --git a/playwright/tests/detail_page/test_metadata_info_tab.py b/playwright/tests/detail_page/test_metadata_info_tab.py new file mode 100644 index 00000000..1d2faed1 --- /dev/null +++ b/playwright/tests/detail_page/test_metadata_info_tab.py @@ -0,0 +1,42 @@ +import pytest +from playwright.sync_api import Page, expect + +from pages.detail_page import DetailPage + + +@pytest.mark.parametrize( + 'title, uuid, metadata_contact, metadata_identifier, metadata_dates', + [ + ( + 'Integrated Marine Observing System (IMOS) - Location of assets', + '1fba3a57-35f4-461b-8a0e-551af229714e', + 'Integrated Marine Observing System (IMOS)', + '1fba3a57-35f4-461b-8a0e-551af229714e', + 'CREATION: Thu Jul 09 2020 15:40:31 GMT+0000', + ), + ], +) +def test_metadata_info_sections( + page_mock: Page, + title: str, + uuid: str, + metadata_contact: str, + metadata_identifier: str, + metadata_dates: str, +) -> None: + detail_page = DetailPage(page_mock) + + detail_page.load(uuid) + expect(detail_page.page_title).to_have_text(title) + metadata_info = detail_page.tabs.metadata_info + metadata_info.tab.click() + + metadata_info.metadata_dates.click() + expect(detail_page.get_text(metadata_dates)).to_be_in_viewport() + + metadata_info.metadata_identifier.click() + expect(detail_page.get_text(metadata_identifier)).to_be_in_viewport() + + metadata_info.metadata_contact.click() + expect(metadata_info.meradata_contact_title).to_be_in_viewport() + expect(metadata_info.meradata_contact_title).to_have_text(metadata_contact) diff --git a/src/components/details/LinkCard.tsx b/src/components/details/LinkCard.tsx index 2ed23736..67f66503 100644 --- a/src/components/details/LinkCard.tsx +++ b/src/components/details/LinkCard.tsx @@ -31,6 +31,7 @@ const LinkCard = ({ backgroundColor: color.blue.light, }, }} + data-testid="links-card" > diff --git a/src/components/list/CollapseList.tsx b/src/components/list/CollapseList.tsx index 7505224a..379109b9 100644 --- a/src/components/list/CollapseList.tsx +++ b/src/components/list/CollapseList.tsx @@ -7,19 +7,26 @@ interface CollapseListProps { title: string; items: { title: string; content: string[] }[]; areAllOpen?: boolean; + testId?: string; } const CollapseList: React.FC = ({ title, items, areAllOpen = false, + testId, }) => { // children list const collapseComponents: ReactNode[] = useMemo(() => { const returnedList: ReactNode[] = []; items?.map((item, index) => { returnedList.push( - + {item.content?.map((content, index) => ( ))} diff --git a/src/components/list/MetadataContactList.tsx b/src/components/list/MetadataContactList.tsx index 41974dff..9cac6275 100644 --- a/src/components/list/MetadataContactList.tsx +++ b/src/components/list/MetadataContactList.tsx @@ -33,7 +33,10 @@ const MetadataContactList: React.FC = ({ - + {contact.organization + suffix} diff --git a/src/components/list/listItem/CollapseItem.tsx b/src/components/list/listItem/CollapseItem.tsx index 14e4f5e8..8e93b467 100644 --- a/src/components/list/listItem/CollapseItem.tsx +++ b/src/components/list/listItem/CollapseItem.tsx @@ -12,6 +12,7 @@ interface CollapseFrameProps { isAssociatedRecord?: boolean; isOpen?: boolean; email?: string; + testId?: string; } const CollapseItem: React.FC = ({ @@ -21,6 +22,7 @@ const CollapseItem: React.FC = ({ isAssociatedRecord = false, isOpen = false, email, + testId, }) => { const [isExpanded, setIsExpanded] = useState(isOpen); @@ -40,6 +42,7 @@ const CollapseItem: React.FC = ({ sx={{ alignSelf: "center", }} + data-testid={testId} > { diff --git a/src/components/list/listItem/subitem/ContactArea.tsx b/src/components/list/listItem/subitem/ContactArea.tsx index 3cc538aa..894785d9 100644 --- a/src/components/list/listItem/subitem/ContactArea.tsx +++ b/src/components/list/listItem/subitem/ContactArea.tsx @@ -45,7 +45,7 @@ const ContactArea: React.FC = ({ contact }) => { postal_code || administrative_area) && } - + {delivery_point?.map((line) => { return ( @@ -76,7 +76,7 @@ const ContactArea: React.FC = ({ contact }) => { )} - + {phones && phones.map((phone) => { return ( @@ -97,7 +97,7 @@ const ContactArea: React.FC = ({ contact }) => { })} - + {links && links.map((link) => { return ( diff --git a/src/pages/detail-page/subpages/tab-panels/AboutPanel.tsx b/src/pages/detail-page/subpages/tab-panels/AboutPanel.tsx index aceb252c..3e5de3ff 100644 --- a/src/pages/detail-page/subpages/tab-panels/AboutPanel.tsx +++ b/src/pages/detail-page/subpages/tab-panels/AboutPanel.tsx @@ -73,7 +73,13 @@ const AboutPanel = () => { }, { title: "Keywords", - component: , + component: ( + + ), }, ], [aboutContacts, credits, keywords] From 3ddc476958518e03fb7512adfe189383c926148e Mon Sep 17 00:00:00 2001 From: AR-RIFAT Date: Tue, 17 Sep 2024 17:12:30 +1000 Subject: [PATCH 2/5] :white_check_mark: fix skipped tests --- playwright/mocks/api/autocomplete.py | 21 +- .../1fba3a57-35f4-461b-8a0e-551af229714e.json | 115 ++++ .../mocks/mock_data/suggester_options.json | 602 +++++++++--------- playwright/pages/base_page.py | 6 + playwright/pages/components/tabs/about.py | 24 +- .../components/tabs/associated_records.py | 24 +- playwright/pages/components/tabs/citation.py | 30 +- .../pages/components/tabs/metadata_info.py | 21 +- playwright/pages/detail_page.py | 3 - playwright/pages/search_page.py | 9 +- .../tests/detail_page/test_about_tab.py | 16 +- .../test_associated_records_tab.py | 26 +- .../tests/detail_page/test_citation_tab.py | 33 +- .../tests/detail_page/test_detail_page.py | 15 +- .../detail_page/test_metadata_info_tab.py | 22 +- playwright/tests/search/test_map.py | 23 +- playwright/tests/search/test_search.py | 3 +- src/components/list/CollapseList.tsx | 9 +- src/components/list/ExpandableList.tsx | 2 +- src/components/list/listItem/CollapseItem.tsx | 3 - .../subpages/tab-panels/AboutPanel.tsx | 8 +- 21 files changed, 608 insertions(+), 407 deletions(-) diff --git a/playwright/mocks/api/autocomplete.py b/playwright/mocks/api/autocomplete.py index 8682dc31..4c1e605c 100644 --- a/playwright/mocks/api/autocomplete.py +++ b/playwright/mocks/api/autocomplete.py @@ -9,10 +9,12 @@ class SuggesterOptions: def __init__( - self, category_suggestions: List[str], suggest_phrases: List[str] + self, + suggested_organisation_vocabs: List[str], + suggested_phrases: List[str], ): - self.category_suggestions = category_suggestions - self.suggest_phrases = suggest_phrases + self.suggested_organisation_vocabs = suggested_organisation_vocabs + self.suggested_phrases = suggested_phrases def filter_items(self, items: List[str], keyword: str) -> List[str]: keyword_lower = keyword.lower() @@ -21,18 +23,21 @@ def filter_items(self, items: List[str], keyword: str) -> List[str]: def get_suggestions( self, input: str ) -> Dict[str, Union[List[str], Dict[str, List[str]]]]: - phrases = self.filter_items(self.suggest_phrases, input) + organisation_vocabs = self.filter_items( + self.suggested_organisation_vocabs, input + ) + phrases = self.filter_items(self.suggested_phrases, input) return { - 'category_suggestions': [input], - 'record_suggestions': {'suggest_phrases': phrases}, + 'suggested_organisation_vocabs': organisation_vocabs, + 'suggested_phrases': phrases, } def load_suggester_options(filename: str) -> SuggesterOptions: data = load_json_data(filename) return SuggesterOptions( - category_suggestions=data['category_suggestions'], - suggest_phrases=data['record_suggestions']['suggest_phrases'], + suggested_organisation_vocabs=data['suggested_organisation_vocabs'], + suggested_phrases=data['suggested_phrases'], ) diff --git a/playwright/mocks/mock_data/dataset_detail/1fba3a57-35f4-461b-8a0e-551af229714e.json b/playwright/mocks/mock_data/dataset_detail/1fba3a57-35f4-461b-8a0e-551af229714e.json index c77579ac..74f19827 100644 --- a/playwright/mocks/mock_data/dataset_detail/1fba3a57-35f4-461b-8a0e-551af229714e.json +++ b/playwright/mocks/mock_data/dataset_detail/1fba3a57-35f4-461b-8a0e-551af229714e.json @@ -10,6 +10,7 @@ "Any users of IMOS data are required to clearly acknowledge the source of the material derived from IMOS in the format: \"Data was sourced from Australia’s Integrated Marine Observing System (IMOS) – IMOS is enabled by the National Collaborative Research Infrastructure strategy (NCRIS).\" If relevant, also credit other organisations involved in collection of this particular datastream (as listed in 'credit' in the metadata record)." ] }, + "statement": "DATA COLLECTION:\n Vessels collect 38 kHz acoustic data from either Simrad EK60, ES60 (split beam) or ES70 echosounders. Research vessel RV Southern Surveyor collects concurrent acoustic data at 12 and 120 kHz. The research vessel Aurora Australis collects concurrent acoustic data at 12, 120 and 200 kHz.\n\nDATA POST PROCESSING:\n The three key steps are (1) semi-automated quality control procedures to filter bad data where we also record the percentage of data removed as a metric of data quality, (2) echo integration of the quality controlled data into cells of 1000 m length by 10 m height and (3) packaging echo integrated data into netCDF along with full metadata record.", "contacts": [ { "name": "", @@ -76,6 +77,24 @@ "roles": ["facsimile"] } ] + }, + { + "name": "Mazor, Tessa", + "organization": "Department of Environment, Land, Water and Planning (DELWP), Victorian Government", + "position": "Marine Spatial Analyst", + "emails": ["tessa.mazor@delwp.vic.gov.au"], + "addresses": [ + { + "city": "Melbourne", + "country": "Australia", + "delivery_point": ["Level 2, 8 Nicholas Street"], + "administrative_area": "Victoria", + "postal_code": "3002" + } + ], + "links": [], + "roles": ["citation"], + "phones": [] } ], "license": "Creative Commons Attribution 4.0 International License", @@ -150,6 +169,18 @@ "title": "Integrated Marine Observing System (IMOS) - Location of assets", "description": "IMOS is designed to be a fully-integrated, national system, observing at ocean-basin and regional scales, and covering physical, chemical and biological variables. IMOS observations are carried out by 10 national Facilities, each deploying a particular type of observing platform: Argo Floats, Ships of opportunity, Deep-water moorings, Ocean Gliders, Autonomous underwater vehicles, Coastal moorings, Coastal ocean radars, Animal tracking and monitoring, Wireless sensor networks, and Satellite remote sensing. IMOS Facilities, operated by partner institutions around the country, are funded to deploy equipment and deliver data streams for use by the entire Australian marine and climate science community and its international collaborators.\n\nThe IMOS Ocean Portal (http://imos.aodn.org.au) allows marine and climate scientists and other users to discover and explore data streams coming from all of the Facilities – some in near-real time, and all as delayed-mode, quality-controlled data. \n\nIMOS is supported by the Australian Government and is led by the University of Tasmania on behalf of the Australian marine and climate science community.\n\nThis record provides a visualisation of all IMOS assets, from its ten facilities.", "links": [ + { + "href": "https://thredds.aodn.org.au/thredds/catalog/IMOS/SOOP/SOOP-BA/catalog.html", + "rel": "related", + "type": "text/html", + "title": "Data Link" + }, + { + "href": "/metadata/8edf509b-1481-48fd-b9c5-b95b42247f82", + "rel": "related", + "type": "text/html", + "title": "AODN record" + }, { "href": "http://imos.org.au", "rel": "self", @@ -198,6 +229,12 @@ "type": "text/html", "title": "Full metadata link" }, + { + "href": "https://metadata.imas.utas.edu.au/geonetwork/srv/eng/catalog.search#/metadata/0145df96-3847-474b-8b63-a66f0e03ff54", + "rel": "describedby", + "type": "text/html", + "title": "Full metadata link" + }, { "href": "https://licensebuttons.net/l/by/4.0/88x31.png", "rel": "license", @@ -285,6 +322,84 @@ "rel": "sibling", "type": "application/json", "title": "{\"title\":\"IMOS - Satellite Remote Sensing (SRS) facility\",\"recordAbstract\":\"The aim of the Satellite Remote Sensing (SRS) facility is to provide access to a range of satellite derived marine data products covering the Australian region.\\n\\nThe SRS has established a new X-Band reception facility at the Australian Institute of Marine Research near Townsville and upgraded the Tasmanian Earth Resource Satellite Station near Hobart. \\n\\nThese stations and facilities in Perth, Melbourne, Alice Springs and Darwin form a network supplying the SRS with near real-time data. These data are combined and processed to a number of products which are placed on disk storage systems in Melbourne, Canberra and Perth.\\n\\nThe Bureau of Meteorology has developed a sea surface temperature (SST) product in GHRSST-PP (http://ghrsst-pp.metoffice.com/) L3P format. The Bureau is developing some other SST products including daily and skin SSTs.\\nThese new products and some ¿ocean colour¿ products from MODIS will gradually become available.\\n\\nScientific users can access these data products are available through OPeNDAP and THREDDS supported technology and also through interfaces provided by eMII and the SRS (www.imos.org.au and www.imos.org.au/srs).\"}" + }, + { + "href": "uuid:f9c151bd-d95b-4af6-8cb7-21c05b7b383b", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - Australian National Mooring Network (ANMN) Facility\",\"recordAbstract\":\"The Australian National Mooring Network Facility is a series of national reference stations and regional moorings designed to monitor particular oceanographic phenomena in Australian coastal ocean waters. \\n\\nThere are seven sub-facilities in the ANMN: four regional sub-facilities, a series of National Reference Stations (NRS), Acoustic Observatories and an Acidification Moorings sub-facility.\\n\\nThe ANMN sub-facilities are:\\na) Queensland and Northern Australia\\nb) New South Wales\\nc) Southern Australia\\nd) Western Australia\\ne) Acoustic Observatories \\nf) National Reference Stations (Coordination and Analysis)\\ng) Acidification Moorings\\n\\nThe National Reference Stations were first established in the 1940’s and are the backbone component of the observing system. Extended by IMOS from three to nine sites around the entire Australian continent, the stations report integrated biological, chemical and physical oceanography time series observations, upon which more intensive local and regional scale studies can be referenced against. The regional moorings monitor the interaction between boundary currents and shelf water masses and their consequent impact upon ocean productivity (e.g. Perth Canyon Upwelling; Kangaroo Island Upwelling) and ecosystem distribution and resilience (e.g. Coral Sea interaction with the Great Barrier Reef ). Operation of the network is distributed between several operators and coordinated nationally.\\n\\nPassive acoustic listening station arrays are located at three sites. These stations provide baseline data on ambient oceanic noise, detection of fish and mammal vocalizations and detection of underwater events. The Acidification Moorings are co-located at three of the National Reference Stations, and provide key observations to help us understand and address the problem of increasing ocean acidification.\"}" + }, + { + "href": "uuid:d52d1e34-b8e2-45d4-a684-be05cd681ef1", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS Enhancement of Measurements on Ships of Opportunity (SOOP) Facility\",\"recordAbstract\":\"The Ship of Opportunity (SOOP) Facility encompasses both the open ocean and coastal waters, in support of short time-scales associated with ocean prediction and the longer term scales of climate research. The aim of the SOOP Facility is to implement an integrated observing system in Australian regional seas that link physical, chemical and biological oceanography. Our ships of opportunity include both commercial vessels on regular routes and research vessels covering more varied routes. \\nThe target regions are the boundary current systems off Eastern and Western Australia, the Southern Ocean, the shelf seas across northern Australia, and the Great Barrier Reef. This is achieved by the following specific goals:\\n1.\\tImplement vessels on suitable routes with an integrated system of measurements including physical and biogeochemical parameters \\na.\\tMonitor the major boundary currents systems around Australia.\\nb.\\tMonitor both local processes and the interactions of the boundary currents on the continental shelf \\n2.\\tProvide in situ input and/or validation to model and data analyses covering the waters around Australia.\\n\\nInstrument Platforms\\n\\nHigh-density XBT Sections - Five major (HRX) high-resolution XBT lines provide boundary to boundary profiling, closely spaced sampling to resolve mesoscale eddies, fronts and boundary currents. The lines are repeated 4 times per year with an on-board technician. The routes sample each major boundary current system using available commercial vessel traffic. All of the transects transmit data in real-time.\\n \\nBiogeochemical Program - uses the RV Southern Surveyor and the l' Astrolabe which sample the critical regions of the Southern Ocean and Australian waters, which have a major impact on CO2 uptake by the ocean and are regions where biogeochemical cycling is predicted to be sensitive to changing climate. Southern Surveyor has a wide spatial coverage and each year covers tropical to sub-polar waters. \\n\\nAusCPR - To monitor plankton we use the Continuous Plankton Recorder (CPR), the only platform that can assess plankton species and be towed behind ships of opportunity. Species-level data are vital to examine mesoscale productivity, biodiversity, and climate impacts on marine ecosystems. Two seasonal routes are operated, in the Southern Ocean, and the East Australian Current\\n\\nSensors on Tropical Research Vessels - Fixed sensor sets maintained on the 2 tropical research vessels (RV Cape Ferguson and RV Solander). The instruments obtain underway observations of temperature, salinity, chlorophyll, fluorescence, light absorption, and irradiance. \\n\\nSST Sensors - Implemented on Australian Volunteer Observing Fleet (AVOF) vessels and several passenger ferries. Hull-mounted sensors supply high-quality bulk SST data fed into existing data management systems and broadcast via satellite back to Australia every one to three hours. Radiometers on ferries supply high-quality skin SST data in near real-time. \\n\\nResearch Vessel Real-time Air-Sea Fluxes - Research vessels have been equipped with \\\"climate quality\\\" met. systems, providing high quality air-sea flux measurements and delivered in near real-time. Data are broadcast via satellite back to Australia daily.\"}" + }, + { + "href": "uuid:1fba3a57-35f4-461b-8a0e-551af229714e", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"Integrated Marine Observing System (IMOS) - Location of assets\",\"recordAbstract\":\"IMOS is designed to be a fully-integrated, national system, observing at ocean-basin and regional scales, and covering physical, chemical and biological variables. IMOS observations are carried out by 10 national Facilities, each deploying a particular type of observing platform: Argo Floats, Ships of opportunity, Deep-water moorings, Ocean Gliders, Autonomous underwater vehicles, Coastal moorings, Coastal ocean radars, Animal tracking and monitoring, Wireless sensor networks, and Satellite remote sensing. IMOS Facilities, operated by partner institutions around the country, are funded to deploy equipment and deliver data streams for use by the entire Australian marine and climate science community and its international collaborators.\\n\\nThe IMOS Ocean Portal (http://imos.aodn.org.au) allows marine and climate scientists and other users to discover and explore data streams coming from all of the Facilities – some in near-real time, and all as delayed-mode, quality-controlled data. \\n\\nIMOS is supported by the Australian Government and is led by the University of Tasmania on behalf of the Australian marine and climate science community.\\n\\nThis record provides a visualisation of all IMOS assets, from its ten facilities.\"}" + }, + { + "href": "uuid:1a69252d-38e4-4e95-8af8-ff92fb144cfe", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - Australian Coastal Ocean Radar Network (ACORN) Facility\",\"recordAbstract\":\"The Australian Coastal Ocean Radar Network (ACORN) facility comprises a coordinated network of HF radars delivering real-time, non-quality controlled and delayed-mode, quality controlled surface current data into a national archive. \\n\\nBased on experience in Europe and the USA, deployment of these radars is expected to make a profound change to coastal ocean research in Australia. HF radar provides unprecedented time-resolved surface current maps over the monitoring sites for physical and biological ocean research. \\n\\nDeployment of the radars is in support of regional nodes where there is a range of identified questions concerned with boundary currents and associated eddies and their interactions with shelf water and topography. In turn these are linked to productivity, connectivity of biological populations and phenomena such as coral bleaching and diseases. It provides a basis for applied research in wave prediction and offers test sites for hydrodynamic modelling. \\n\\nThe equipment comprises long-range WERA and medium-range WERA systems and long-range SeaSonde systems, and associated spares and transport infrastructure. An existing system that was installed by James Cook University in the Capricorn/Bunker region around Heron Island on the Great Barrier Reef was integrated into the network. An HF radar acquisition by a consortium led by South Australian Research and Development Institute in South Australia was also integrated into the network.\"}" + }, + { + "href": "uuid:3e575769-201b-4928-a15d-11ec7e5a7bdd", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - Deep Water Moorings Facility\",\"recordAbstract\":\"The Deep Water Moorings Facility (formerly known as the Australian Bluewater Observing System) provides the coordination of national efforts in the sustained observation of open ocean properties with particular emphasis on observations important to climate and carbon cycle studies. The major areas of research driving the facility include:\\n* tracking multi-decadal ocean change and predicting regional and marine impacts;\\n* understanding the modes and drivers of climate variability in the Australian region;\\n* improved understanding and prediction of ocean currents; and\\n* discovering the links between ocean and climate variability, marine chemical cycling and ecosystem structure and function at various time scales.\\n\\nObservations are primarily obtained from moorings specially designed for each site. Autonomous profiling floats and gliders have also been deployed at the Southern Ocean sites to obtain complementary data. Operation of the facility is spread between three sub-facilities.\\n\\n1) The Air-Sea Flux Stations (ASFS) sub-facility focuses on marine meteorology and delivers measurements which are necessary for computing air-sea fluxes of heat, momentum and mass with the option to measure surface photosynthetically active radiation and surface UV to help assess light available for phytoplankton production.\\n\\n2) Southern Ocean Time Series (SOTS) provides high temporal resolution measurements of physical, chemical and biogeochemical parameters in sub-Antarctic waters. The emphasis is on inter-annual variations of upper ocean properties and their influence on exchange with the deep ocean. \\n\\n3) Deepwater Arrays (DA) includes observational programs based on moored conductivity-temperature-depth sensors and current meter arrays in deep waters that are specifically targeted to monitor formation of Antarctic Bottom Water, inter-basin exchange and major boundary currents. The Deepwater array sites include: \\na) Polynya Array - the Adelie Land Coast deep shelf to observe outflows of newly forming Antarctic Bottom water, \\nb) Indonesian Throughflow (ITF) Array - Timor Passage and Ombai Strait, to monitor the inter-basin Indian-Pacific Ocean exchange and the upper limb of the global overturning circulation, \\nc) East Australian Current (EAC) Array - east coast of Australia, near Brisbane, to monitor EAC transport.\"}" + }, + { + "href": "uuid:4260aa0a-0d0a-4dd0-9ebc-74d2bf937e21", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - Facility for Automated Intelligent Monitoring of Marine Systems (FAIMMS)\",\"recordAbstract\":\"The IMOS Facility for Intelligent Monitoring of Marine Systems is a sensor network established in the Great Barrier Reef off the coast of Queensland, Australia. A 'sensor network' is an array of small, wirelessly interconnected sensors that collectively stream sensor data to a central data aggregation point. Sensor networks can be used to provide spatially dense bio-physical measurements in real-time. In the marine environment they have particular application to the study of benthic ecosystems. Some sensors can be set to sample according to prevailing conditions (e.g. monitoring salinity more frequently after rainfall), but since communications with the sensors can be bi-directional they can also be manipulated by central land-based control systems. FAIMMS sensors collect data related to the interaction of heat and light in coral bleaching, and to help understand the impact of upwelling from the Coral Sea upon the productivity of Great Barrier Reef ecosystems. While sensor networks are a leading edge technology, they are well suited to this application because proven technologies exist for reliable sensing of physical variables (e.g. temperature, salinity, light) critical to the immediate scientific questions, which are: 1. understanding the interaction of heat and light in coral bleaching, and 2. understanding the impact of upwelling from the Coral Sea upon the productivity of GBR ecosystems. The immediate value of the network will be its ability to return spatially dense bio-physical measurements in real-time. As such this represents a large scale trial or \\\"proof of concept\\\" of a very important emerging technology for application in the marine environment with particular relevance to benthic ecosystems such as Great Barrier Reef and other benthic environments. Some sites have been partially or fully decommissioned in regards to IMOS: Heron Island (2008 - present) - partial; One Tree Island (2008 - present) - partial; Davies Reef (2009 - 2018); Myrmidon Reef (2009 - 2015); Rib Reef (2009 - 2017); Orpheus Island (2009 - present); Lizard Island (2010 - present) - partial. In some circumstances the Australian Institute of Marine Science (AIMS), has taken over the operation of the site, or equipment within it (see http://imos.org.au/wirelesssensornetworks.html for more details), and IMOS will continue to pull data from them.\"}" + }, + { + "href": "uuid:11b3ccd0-d9e0-11dc-8635-00188b4c0af8", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - Australian National Facility for Ocean Gliders (ANFOG)\",\"recordAbstract\":\"The Australian National Facility for Ocean Gliders (ANFOG), deploys a fleet of gliders around Australia.\\n\\nThe underwater ocean glider represents a technological revolution for oceanography. Autonomous ocean gliders can be built relatively cheaply, are controlled remotely and are reusable allowing them to make repeated subsurface ocean observations at a fraction of the cost of conventional methods. The data retrieved from the glider fleet will contribute to the study of the major boundary current systems surrounding Australia and their links to coastal ecosystems.\\n\\nThe ANFOG glider fleet consists of two types; Slocum gliders and Seagliders. \\nSlocum gliders (named for Joshua Slocum, the first solo global circumnavigator), manufactured by Webb Research Corp are optimised for shallow coastal waters (<200m) where high manoeuvrability is needed. ANFOG will have Slocum gliders for deployment on the continental shelf. Seagliders, built at the University of Washington, are designed to operate more efficiently in the open ocean up to 1000m water depth. ANFOG uses their Seagliders to monitor the boundary currents and continental shelves, which is valuable for gathering long-term environmental records of physical, chemical and biological data not widely measured to date. Whilst the Slocum gliders, due to their low cost and operational flexibility, will be of great use in intensive coastal monitoring, both types of gliders weigh only 52kg, enabling them to be launched from small boats. They have a suite of sensors able to record temperature, salinity, dissolved oxygen, turbidity, dissolved organic matter and chlorophyll against position and depth\\n\\nThe use of these contemporary gliders provides a unique opportunity to effectively measure the boundary currents off Australia, which are the main link between open-ocean and coastal processes. A number of gliders are operated with target regions including the Coral Sea, East Australian Current off New South Wales and Tasmania, Southern Ocean southwest of Tasmania, the Leeuwin and Capes Currents off South Western Australia and the Pilbara and Kimberly regions off North Western Australia.\"}" + }, + { + "href": "uuid:677a6c35-0c34-4479-afd3-cb0d2d091cfa", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - Argo Australia Facility\",\"recordAbstract\":\"Argo Australia aims to undertake real time monitoring of the broad ocean state around Australia by maintaining an array of profiling (Argo) floats that measure temperature and salinity down to 2000m every 10 days in real time. This provides the essential and dominant in situ data stream for ocean and climate research and prediction/re-analyses.\\n\\nThe primary goal of the Argo program is to maintain a global array of autonomous profiling floats integrated with other elements of the climate observing system.\\nThe specific aims are to:\\n - detect climate variability over seasonal to decadal time-scales including changes in the large-scale distribution of temperature and salinity and in the transport of these properties by large-scale ocean circulation.\\n - provide information needed for the calibration of satellite measurements.\\n - deliver data for the initialization and constraint of climate models.\\n\\nArgo Australia is the third largest contributer to the global array (in terms of instrument numbers) after the Us and Japan.\\n\\nTo ensure 50% of the minimum design coverage of 1 float every 3 x3 degrees of latitude/longitude in the Australian region (i.e. between 90oE to 18oE, equator to Antarctic) requires deployment of 60 floats per year with the balance derived from international partners. The NCRIS investment along with currently identified Australian partners will provide for ~ 75 % of this requirement with further opportunities for co-investment. \\n\\nWork is underway to equip 30 floats per annum with oxygen sensors to address carbon cycle and biogeochemical cycling (BGC) variability in the Southern Ocean which is a significant component of the world climate and carbon cycling system. Additional investment would be required for this to occur.\"}" + }, + { + "href": "uuid:95c09bad-1847-48f0-9ed7-1ba36e7abb8d", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - New Technology Proving - Low Cost Wave Buoys\",\"recordAbstract\":\"The Low Cost Wave Buoy Technology Sub-Facility, part of the New Technology Proving Facility, will focus primarily on Spotter Wave Buoys, developed by Sofar Ocean Technologies. These Spotter wave buoys are significantly less expensive relative to conventional wave buoys, smaller in size and easier to deploy.\\n\\nLow Cost Wave Buoy Technology aims to assess the performance of Spotter wave buoys over a wide range of oceanic conditions and determine their reliability for long-term deployments compared to conventional wave buoys. \\n\\nThere are presently 4 IMOS sites, these are: \\no Torbay – 2 x Spotters (multiple deployments)\\no Goodrich Bank – 1 x Spotter (single deployment)\\no Tantabiddi – 1 x Spotter (single deployment)\\no Cape Bridgewater – 2 x Spotter (multiple deployments)\\n\\n\\nThe data from these buoys will be available in delayed mode as part of the National Wave Archive (https://imos.aodn.org.au/imos123/home?uuid=2807f3aa-4db0-4924-b64b-354ae8c10b58), with plans to provide near real-time data in the future.\"}" + }, + { + "href": "uuid:744ac2a9-689c-40d3-b262-0df6863f0327", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - Satellite Remote Sensing (SRS) facility\",\"recordAbstract\":\"The aim of the Satellite Remote Sensing (SRS) facility is to provide access to a range of satellite derived marine data products covering the Australian region.\\n\\nThe SRS has established a new X-Band reception facility at the Australian Institute of Marine Research near Townsville and upgraded the Tasmanian Earth Resource Satellite Station near Hobart. \\n\\nThese stations and facilities in Perth, Melbourne, Alice Springs and Darwin form a network supplying the SRS with near real-time data. These data are combined and processed to a number of products which are placed on disk storage systems in Melbourne, Canberra and Perth.\\n\\nThe Bureau of Meteorology has developed a sea surface temperature (SST) product in GHRSST-PP (http://ghrsst-pp.metoffice.com/) L3P format. The Bureau is developing some other SST products including daily and skin SSTs.\\nThese new products and some ¿ocean colour¿ products from MODIS will gradually become available.\\n\\nScientific users can access these data products are available through OPeNDAP and THREDDS supported technology and also through interfaces provided by eMII and the SRS (www.imos.org.au and www.imos.org.au/srs).\"}" + }, + { + "href": "uuid:a8ac955c-2280-4684-8e38-5b4ca112c9c6", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - IMOS NetCDF Conventions Manual\",\"recordAbstract\":\"The main purpose of this document is to specify the format of the files that are used to distribute Australia’s Integrated Marine Observing System (IMOS) data, and to document the standards used therein. This includes naming conventions, or taxonomy, as well as metadata content.\\n\\nThe IMOS NetCDF Conventions document was originally based on the one prescribed by the OceanSITES User’s Manual, version 1.1. As both documents have evolved since, there are now significant differences between them but we will try to reduce this gap in the future. The OceanSITES program is the global network of open-ocean sustained time series reference stations that have been implemented by an international partnership of researchers.\"}" + }, + { + "href": "uuid:a35d02d7-3bd2-40f8-b982-a0e30b64dc40", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - Animal Tracking Facility\",\"recordAbstract\":\"The IMOS Animal Tracking Facility (formerly known as the Australian Animal Tracking And Monitoring System (AATAMS)) represents the higher biological monitoring of the marine environment for the IMOS program. Currently the facility uses acoustic technology, CTD satellite trackers and bio loggers to monitor coastal and oceanic movements of marine animals from the Australian mainland to the sub-Antarctic islands and as far south as the Antarctic continent. \\n\\nAcoustic monitoring is a powerful tool for observing tagged marine animals with networks or cross shelf arrays (curtains) of receivers, allowing animals to be monitored over scales of hundreds of metres to thousands of kilometres. An array or network consists of a series of acoustic receivers that are strategically deployed on the sea floor for 1 to 10 years (depending on receiver type and battery life) with the ability to download data from the receivers as often as required. NCRIS and partner investments will target areas identified by regional nodes. \\n\\nVR2's deployed in conjunction with other moorings will provide information on long range movement of a variety of species including endangered and protected species (i.e. White Sharks and Grey Nurse Sharks), and valuable commercial species (i.e. Tuna)\\n\\nCurtains are mobile and can be deployed in different configurations for specific IMOS projects. The continued coordination of acoustic tag codes between researchers means that acoustic array around Australia will provide the combined infrastructure to monitor movement of highly migratory marine species between all jurisdictions.\\n\\nCTD satellite trackers and bio loggers currently deployed on a large range of animals are collecting a wide range of data. This includes behavioural and physical data such as the depth, temperature, salinity and movement effort of individual marine animals. \\n\\nThe Animal Tracking Facility is set up to collect data over a long period of time. This sustained approach will enable researchers to assess the effects of climate change, ocean acidification and other physical changes that affect animals within the marine environment.\"}" + }, + { + "href": "uuid:af5d0ff9-bb9c-4b7c-a63c-854a630b6984", + "rel": "child", + "type": "application/json", + "title": "{\"title\":\"IMOS - Autonomous Underwater Vehicle (AUV) Facility\",\"recordAbstract\":\"The IMOS Autonomous Underwater Vehicle (AUV) Facility operates multiple ocean-going AUVs capable of undertaking high resolution, geo-referenced survey work. AUV Sirius is a modified version of a mid-size robotic vehicle Seabed built at the Woods Hole Oceanographic Institution. This class of AUV has been designed specifically for low speed, high resolution imaging and is passively stable in pitch and roll. AUV Nimbus is a custom design with the aim of deploying off smaller vessels than Sirius whilst remaining able to operate in similar environments. AUV Iver is an extended Ocean Server Iver2 class platform with additional navigation and imaging sensors but lacks the ability to work over complex underwater terrain. Based on its small size, it can be deployed from RHIBs and other small vessels. The main objective of the IMOS AUV Facility is to support sustained observations of the benthos, in support of the IMOS integrated benthic monitoring program. . The AUV facility is based at the Australian Centre for Field Robotics (ACFR) within the School of Aerospace, Mechanical and Mechatronic Engineering at the University of Sydney.\\n\\nThis IMOS Facility finished in June 2023, with data still available through the AODN Portal.\"}" } ], "extent": { diff --git a/playwright/mocks/mock_data/suggester_options.json b/playwright/mocks/mock_data/suggester_options.json index d77bbdd5..faf93cfd 100644 --- a/playwright/mocks/mock_data/suggester_options.json +++ b/playwright/mocks/mock_data/suggester_options.json @@ -1,300 +1,306 @@ { - "category_suggestions": ["Wave", "Temperature", "Air temperature"], - "record_suggestions": { - "suggest_phrases": [ - "used long wave", - "wavelengths multi", - "heat outgoing long wave", - "wave short", - "wave height can", - "long wave outgoing short", - "wave minimum", - "wavelengths", - "significant wave", - "pressure long wave", - "wave short wave ultraviolet", - "wave", - "wave minimum value used", - "long wave short", - "significant wave height", - "significant wave height can", - "air pressure long wave", - "layer multiple wavelengths", - "outgoing short wave", - "wave short wave", - "short wave heat", - "short wave ultraviolet", - "wave minimum value", - "wave outgoing short wave", - "long wave short wave", - "wave outgoing", - "wave ultraviolet photosynthetically", - "wave height", - "wavelengths multi spectral", - "pressure long wave short", - "directions significant wave", - "long wave", - "outgoing long wave outgoing", - "wave outgoing short", - "wave ultraviolet", - "outgoing long wave", - "multiple wavelengths", - "long wave minimum", - "long wave outgoing", - "multiple wavelengths multi", - "long wave minimum value", - "wave heat", - "wave heat due", - "short wave", - "air atmospheric xco2", - "outside air from", - "air pressure calculated", - "air sea fluxes calculated", - "opportunity soop air", - "air temperature humidity", - "real time air", - "time air sea fluxes", - "selected air", - "air sea temperature", - "co2 air atmospheric", - "clean outside air", - "air pressure", - "bulk air sea fluxes", - "bulk air", - "air pressure long wave", - "meteorology air", - "air sea fluxes", - "instrument selected air", - "air pressure calculated fluxes", - "upwind instrument selected air", - "sst air", - "sst air pressure", - "quality air", - "calculated air", - "provided air", - "pumping clean outside air", - "set air sea", - "air sea flux sub", - "humidity air pressure", - "co2 air", - "soop air sea", - "set air", - "temperatures sst air", - "air sea fluxes enhancement", - "relative humidity air", - "clean outside air from", - "air sea", - "quality air sea flux", - "instrument selected air temperature", - "air gas", - "observations wind air", - "air sea fluxes equips", - "speed direction air", - "air sea fluxes essential", - "humidity air pressure long", - "air temperature relative humidity", - "direction provided air temperature", - "air temperature relative", - "air", - "air temperature", - "direction air temperature relative", - "humidity air", - "provided air temperature", - "air from intake", - "calculated air sea", - "air gas flow", - "time air sea", - "wind air", - "well calculated air", - "selected air temperature", - "real time air sea", - "air atmospheric xco2 dry", - "observations bulk air", - "temperature relative humidity air", - "providing high quality air", - "outside air", - "soop air sea flux", - "high quality air", - "time air", - "air pressure long", - "air sea flux", - "relative humidity air pressure", - "high quality air sea", - "bulk air sea", - "meteorology air sea", - "dried air gas", - "wind air sea", - "air sea fluxes aims", - "calculated air sea fluxes", - "direction air temperature", - "air atmospheric", - "air sea flux asf", - "soop air", - "quality air sea", - "vessel real time air", - "air from", - "direction air", - "full set air", - "direction provided air", - "dried air", - "opportunity soop air sea", - "air sea flux measurements", - "system remote temperature", - "equilibrator temperature records shows", - "temperature retrievals", - "thermosalinograph equilibrator temperature", - "surface temperature retrievals", - "collect temperature", - "temperature sensor seabird electronics", - "collect temperature pressure", - "dataset contains temperature", - "temperature salinity", - "temperature wind", - "contains temperature", - "surface temperature sst", - "dataset temperature salinity", - "temperature salinity biological", - "sea surface temperature", - "temperature data aqualogger 520t", - "temperature salinity conductivity", - "dataset temperature", - "addition temperature", - "shows temperature difference", - "currents temperature salinity", - "sea surface temperature sst", - "temperature data", - "depth remote temperature", - "measure sea surface temperature", - "temperature records shows", - "remote temperature sensor seabird", - "temperature sst sea", - "temperature pressure data", - "temperature sensor", - "using sea surface temperature", - "temperature sst travel", - "currents temperature", - "temperature records", - "temperature pressure", - "temperature salinity conductivity density", - "remote temperature", - "observations currents temperature", - "temperature data aqualogger", - "temperature", - "temperature difference", - "remote temperature sensor", - "temperature sst", - "sea surface temperature retrievals", - "dataset contains temperature salinity", - "equilibrator temperature records", - "aqualogger 520pt temperature", - "520pt temperature", - "shows temperature", - "temperature retrievals from", - "records shows temperature", - "surface temperature retrievals from", - "520pt temperature data", - "equilibrator temperature", - "contains temperature salinity", - "temperature sensor seabird", - "temperature sst sea surface", - "surface temperature", - "surface temperature sst sea", - "mooring collect temperature", - "imos.org.au", - "imos argo", - "rv southern surveyor imos", - "imos nrs field", - "imos project data", - "surveyor imos platform", - "imos australia biogeochemical argo", - "marine observing system imos", - "imos project", - "imos nrs national", - "imos infrastructure station", - "50m mooring imos platform", - "imos infrastructure station metadata", - "imos platform code pil050", - "imos sst products web", - "page http imos.org.au", - "southern surveyor imos", - "aurora australis imos platform", - "first imos", - "mooring imos", - "refer imos", - "surveyor imos platform code", - "imos.aodn.org.au geonetwork srv eng", - "imos argo profiles", - "through imos infrastructure", - "australis imos platform code", - "system imos project", - "collection https catalogue imos.aodn.org.au", - "project first imos", - "imos nrs biogeochemical project", - "imos biogeochemical argo", - "imos argo profiles core", - "imos nrs national reference", - "imos platform code", - "imos nrs", - "imos platform code vnaa", - "https catalogue imos.aodn.org.au", - "catalogue imos.aodn.org.au", - "catalogue imos.aodn.org.au geonetwork", - "http imos.org.au facilities", - "imos ship", - "from imos nrs", - "programs through imos", - "southern surveyor imos platform", - "2011 imos", - "https catalogue imos.aodn.org.au geonetwork", - "imos australia", - "appendix http imos.org.au", - "imos", - "mooring imos platform", - "imos.aodn.org.au geonetwork", - "through imos", - "imos.org.au facilities srs sstproducts", - "imos.org.au sstproducts.html", - "pilbara 50m mooring imos", - "provided imos", - "http imos.org.au facilities srs", - "imos.org.au facilities srs", - "imos.aodn.org.au geonetwork srv", - "extracted from imos", - "included imos", - "2012 imos", - "imos platform code vlhj", - "australis imos platform", - "members imos", - "australis imos", - "imos sst", - "several members imos", - "members imos nrs", - "first imos australia biogeochemical", - "imos australia biogeochemical", - "imos infrastructure", - "http imos.org.au sstproducts.html", - "imos.org.au sstproducts.html further", - "http imos.org.au", - "imos platform", - "imos nrs biogeochemical", - "system imos", - "mooring imos platform code", - "first imos australia", - "imos.aodn.org.au", - "imos biogeochemical", - "observing system imos project", - "aurora australis imos", - "observing system imos", - "imos ship opportunity", - "from imos", - "catalogue imos.aodn.org.au geonetwork srv", - "imos.org.au facilities", - "surveyor imos", - "imos nrs field sampling", - "50m mooring imos", - "imos biogeochemical argo sub", - "rv aurora australis imos", - "imos sst products" - ] - } + "suggested_organisation_vocabs": [ + "animal tracking facility, integrated marine observing system (imos)", + "argo floats facility, integrated marine observing system (imos)", + "wireless sensor networks facility, integrated marine observing system (imos)", + "national mooring network facility, integrated marine observing system (imos)", + "satellite remote sensing facility, integrated marine observing system (imos)" + ], + "suggested_platform_vocabs": [], + "suggested_phrases": [ + "used long wave", + "wavelengths multi", + "heat outgoing long wave", + "wave short", + "wave height can", + "long wave outgoing short", + "wave minimum", + "wavelengths", + "significant wave", + "pressure long wave", + "wave short wave ultraviolet", + "wave", + "wave minimum value used", + "long wave short", + "significant wave height", + "significant wave height can", + "air pressure long wave", + "layer multiple wavelengths", + "outgoing short wave", + "wave short wave", + "short wave heat", + "short wave ultraviolet", + "wave minimum value", + "wave outgoing short wave", + "long wave short wave", + "wave outgoing", + "wave ultraviolet photosynthetically", + "wave height", + "wavelengths multi spectral", + "pressure long wave short", + "directions significant wave", + "long wave", + "outgoing long wave outgoing", + "wave outgoing short", + "wave ultraviolet", + "outgoing long wave", + "multiple wavelengths", + "long wave minimum", + "long wave outgoing", + "multiple wavelengths multi", + "long wave minimum value", + "wave heat", + "wave heat due", + "short wave", + "air atmospheric xco2", + "outside air from", + "air pressure calculated", + "air sea fluxes calculated", + "opportunity soop air", + "air temperature humidity", + "real time air", + "time air sea fluxes", + "selected air", + "air sea temperature", + "co2 air atmospheric", + "clean outside air", + "air pressure", + "bulk air sea fluxes", + "bulk air", + "air pressure long wave", + "meteorology air", + "air sea fluxes", + "instrument selected air", + "air pressure calculated fluxes", + "upwind instrument selected air", + "sst air", + "sst air pressure", + "quality air", + "calculated air", + "provided air", + "pumping clean outside air", + "set air sea", + "air sea flux sub", + "humidity air pressure", + "co2 air", + "soop air sea", + "set air", + "temperatures sst air", + "air sea fluxes enhancement", + "relative humidity air", + "clean outside air from", + "air sea", + "quality air sea flux", + "instrument selected air temperature", + "air gas", + "observations wind air", + "air sea fluxes equips", + "speed direction air", + "air sea fluxes essential", + "humidity air pressure long", + "air temperature relative humidity", + "direction provided air temperature", + "air temperature relative", + "air", + "air temperature", + "direction air temperature relative", + "humidity air", + "provided air temperature", + "air from intake", + "calculated air sea", + "air gas flow", + "time air sea", + "wind air", + "well calculated air", + "selected air temperature", + "real time air sea", + "air atmospheric xco2 dry", + "observations bulk air", + "temperature relative humidity air", + "providing high quality air", + "outside air", + "soop air sea flux", + "high quality air", + "time air", + "air pressure long", + "air sea flux", + "relative humidity air pressure", + "high quality air sea", + "bulk air sea", + "meteorology air sea", + "dried air gas", + "wind air sea", + "air sea fluxes aims", + "calculated air sea fluxes", + "direction air temperature", + "air atmospheric", + "air sea flux asf", + "soop air", + "quality air sea", + "vessel real time air", + "air from", + "direction air", + "full set air", + "direction provided air", + "dried air", + "opportunity soop air sea", + "air sea flux measurements", + "system remote temperature", + "equilibrator temperature records shows", + "temperature retrievals", + "thermosalinograph equilibrator temperature", + "surface temperature retrievals", + "collect temperature", + "temperature sensor seabird electronics", + "collect temperature pressure", + "dataset contains temperature", + "temperature salinity", + "temperature wind", + "contains temperature", + "surface temperature sst", + "dataset temperature salinity", + "temperature salinity biological", + "sea surface temperature", + "temperature data aqualogger 520t", + "temperature salinity conductivity", + "dataset temperature", + "addition temperature", + "shows temperature difference", + "currents temperature salinity", + "sea surface temperature sst", + "temperature data", + "depth remote temperature", + "measure sea surface temperature", + "temperature records shows", + "remote temperature sensor seabird", + "temperature sst sea", + "temperature pressure data", + "temperature sensor", + "using sea surface temperature", + "temperature sst travel", + "currents temperature", + "temperature records", + "temperature pressure", + "temperature salinity conductivity density", + "remote temperature", + "observations currents temperature", + "temperature data aqualogger", + "temperature", + "temperature difference", + "remote temperature sensor", + "temperature sst", + "sea surface temperature retrievals", + "dataset contains temperature salinity", + "equilibrator temperature records", + "aqualogger 520pt temperature", + "520pt temperature", + "shows temperature", + "temperature retrievals from", + "records shows temperature", + "surface temperature retrievals from", + "520pt temperature data", + "equilibrator temperature", + "contains temperature salinity", + "temperature sensor seabird", + "temperature sst sea surface", + "surface temperature", + "surface temperature sst sea", + "mooring collect temperature", + "imos.org.au", + "imos argo", + "rv southern surveyor imos", + "imos nrs field", + "imos project data", + "surveyor imos platform", + "imos australia biogeochemical argo", + "marine observing system imos", + "imos project", + "imos nrs national", + "imos infrastructure station", + "50m mooring imos platform", + "imos infrastructure station metadata", + "imos platform code pil050", + "imos sst products web", + "page http imos.org.au", + "southern surveyor imos", + "aurora australis imos platform", + "first imos", + "mooring imos", + "refer imos", + "surveyor imos platform code", + "imos.aodn.org.au geonetwork srv eng", + "imos argo profiles", + "through imos infrastructure", + "australis imos platform code", + "system imos project", + "collection https catalogue imos.aodn.org.au", + "project first imos", + "imos nrs biogeochemical project", + "imos biogeochemical argo", + "imos argo profiles core", + "imos nrs national reference", + "imos platform code", + "imos nrs", + "imos platform code vnaa", + "https catalogue imos.aodn.org.au", + "catalogue imos.aodn.org.au", + "catalogue imos.aodn.org.au geonetwork", + "http imos.org.au facilities", + "imos ship", + "from imos nrs", + "programs through imos", + "southern surveyor imos platform", + "2011 imos", + "https catalogue imos.aodn.org.au geonetwork", + "imos australia", + "appendix http imos.org.au", + "imos", + "mooring imos platform", + "imos.aodn.org.au geonetwork", + "through imos", + "imos.org.au facilities srs sstproducts", + "imos.org.au sstproducts.html", + "pilbara 50m mooring imos", + "provided imos", + "http imos.org.au facilities srs", + "imos.org.au facilities srs", + "imos.aodn.org.au geonetwork srv", + "extracted from imos", + "included imos", + "2012 imos", + "imos platform code vlhj", + "australis imos platform", + "members imos", + "australis imos", + "imos sst", + "several members imos", + "members imos nrs", + "first imos australia biogeochemical", + "imos australia biogeochemical", + "imos infrastructure", + "http imos.org.au sstproducts.html", + "imos.org.au sstproducts.html further", + "http imos.org.au", + "imos platform", + "imos nrs biogeochemical", + "system imos", + "mooring imos platform code", + "first imos australia", + "imos.aodn.org.au", + "imos biogeochemical", + "observing system imos project", + "aurora australis imos", + "observing system imos", + "imos ship opportunity", + "from imos", + "catalogue imos.aodn.org.au geonetwork srv", + "imos.org.au facilities", + "surveyor imos", + "imos nrs field sampling", + "50m mooring imos", + "imos biogeochemical argo sub", + "rv aurora australis imos", + "imos sst products" + ], + "suggested_parameter_vocabs": [] } diff --git a/playwright/pages/base_page.py b/playwright/pages/base_page.py index 9fcf2d97..b16c73f7 100644 --- a/playwright/pages/base_page.py +++ b/playwright/pages/base_page.py @@ -52,3 +52,9 @@ def get_heading(self, text: str) -> Locator: def click_heading(self, text: str) -> None: """Click on the given heading""" self.get_heading(text).click() + + def get_collapse_list(self, item_list: str) -> Locator: + return self.page.get_by_test_id(f'collapse-list-{item_list}') + + def get_collapse_list_items(self, item_list: str) -> Locator: + return self.get_collapse_list(item_list).get_by_test_id('collapseItem') diff --git a/playwright/pages/components/tabs/about.py b/playwright/pages/components/tabs/about.py index 759a54d3..51766f8f 100644 --- a/playwright/pages/components/tabs/about.py +++ b/playwright/pages/components/tabs/about.py @@ -1,15 +1,29 @@ -from playwright.sync_api import Page +from playwright.sync_api import Locator, Page from pages.base_page import BasePage class AboutTab(BasePage): + TAB_NAME = 'About' + CONTACTS = 'Contacts' + CREDITS = 'Credits' + KEYWORDS = 'Keywords' + def __init__(self, page: Page): self.page = page # Page locators - self.tab = self.get_tab('About') + self.tab = self.get_tab(self.TAB_NAME) # sections - self.contacts = self.get_button('Contacts') - self.credits = self.get_button('Credits') - self.keywords = self.get_button('Keywords') + self.contacts = self.get_button(self.CONTACTS) + self.credits = self.get_button(self.CREDITS) + self.keywords = self.get_button(self.KEYWORDS) + + def get_contacts_list(self) -> Locator: + return self.get_collapse_list(self.CONTACTS) + + def get_credits_list(self) -> Locator: + return self.get_collapse_list(self.CREDITS) + + def get_keywords_list(self) -> Locator: + return self.get_collapse_list(self.KEYWORDS) diff --git a/playwright/pages/components/tabs/associated_records.py b/playwright/pages/components/tabs/associated_records.py index d91741cb..de6addc5 100644 --- a/playwright/pages/components/tabs/associated_records.py +++ b/playwright/pages/components/tabs/associated_records.py @@ -1,15 +1,29 @@ -from playwright.sync_api import Page +from playwright.sync_api import Locator, Page from pages.base_page import BasePage class AssociatedRecordsTab(BasePage): + TAB_NAME = 'Associated Records' + PARENT_RECORD = 'Parent Record' + SIBLING_RECORDS = 'Sibling Records' + CHILD_RECORDS = 'Child Records' + def __init__(self, page: Page): self.page = page # Page locators - self.tab = self.get_tab('Associated Records') + self.tab = self.get_tab(self.TAB_NAME) # sections - self.parent_record = self.get_button('Parent Record') - self.sibling_records = self.get_button('Sibling Records') - self.child_records = self.get_button('Child Records') + self.parent_record = self.get_button(self.PARENT_RECORD) + self.sibling_records = self.get_button(self.SIBLING_RECORDS) + self.child_records = self.get_button(self.CHILD_RECORDS) + + def get_parent_record_list(self) -> Locator: + return self.get_collapse_list(self.PARENT_RECORD) + + def get_sibling_records_list(self) -> Locator: + return self.get_collapse_list(self.SIBLING_RECORDS) + + def get_child_records_list(self) -> Locator: + return self.get_collapse_list(self.CHILD_RECORDS) diff --git a/playwright/pages/components/tabs/citation.py b/playwright/pages/components/tabs/citation.py index 5bdacef5..24f34dc4 100644 --- a/playwright/pages/components/tabs/citation.py +++ b/playwright/pages/components/tabs/citation.py @@ -1,18 +1,36 @@ -from playwright.sync_api import Page +from playwright.sync_api import Locator, Page from pages.base_page import BasePage class CitationTab(BasePage): + TAB_NAME = 'Citation' + CITED_RESPONSIBLE_PARTIES = 'Cited Responsible Parties' + LICENSE = 'License' + SUGGESTED_CITATION = 'Suggested Citation' + CONSTRANITS = 'Constraints' + def __init__(self, page: Page): self.page = page # Page locators - self.tab = self.get_tab('Citation') + self.tab = self.get_tab(self.TAB_NAME) # sections self.cited_responsible_parties = self.get_button( - 'Cited Responsible Parties' + self.CITED_RESPONSIBLE_PARTIES ) - self.license = self.get_button('License') - self.suggested_citation = self.get_button('Suggested Citation') - self.constranits = self.get_button('Constraints') + self.license = self.get_button(self.LICENSE) + self.suggested_citation = self.get_button(self.SUGGESTED_CITATION) + self.constranits = self.get_button(self.CONSTRANITS) + + def get_cited_responsible_parties_list(self) -> Locator: + return self.get_collapse_list(self.CITED_RESPONSIBLE_PARTIES) + + def get_license_list(self) -> Locator: + return self.get_collapse_list(self.LICENSE) + + def get_suggested_citation_list(self) -> Locator: + return self.get_collapse_list(self.SUGGESTED_CITATION) + + def get_constranits_list(self) -> Locator: + return self.get_collapse_list(self.CONSTRANITS) diff --git a/playwright/pages/components/tabs/metadata_info.py b/playwright/pages/components/tabs/metadata_info.py index 17bf5cbe..101831c3 100644 --- a/playwright/pages/components/tabs/metadata_info.py +++ b/playwright/pages/components/tabs/metadata_info.py @@ -1,14 +1,20 @@ -from playwright.sync_api import Page +from playwright.sync_api import Locator, Page from pages.base_page import BasePage class MetadataInfoTab(BasePage): + TAB_NAME = 'Metadata Information' + METADATA_CONTACT = 'Metadata Contact' + METADATA_IDENTIFIER = 'Metadata Identifier' + FULL_METADATA_LINK = 'Full Metadata Link' + METADATA_DATES = 'Metadata Dates' + def __init__(self, page: Page): self.page = page # Page locators - self.tab = self.get_tab('Metadata Information') + self.tab = self.get_tab(self.TAB_NAME) # sections self.metadata_contact = self.get_button('Metadata Contact') self.metadata_identifier = self.get_button('Metadata Identifier') @@ -16,6 +22,15 @@ def __init__(self, page: Page): self.metadata_dates = self.get_button('Metadata Dates') # other - self.meradata_contact_title = page.get_by_test_id( + self.metadata_contact_title = page.get_by_test_id( 'metadata-contact-title' ) + + def get_metadata_identifier_list(self) -> Locator: + return self.get_collapse_list(self.METADATA_IDENTIFIER) + + def get_full_metadata_link_list(self) -> Locator: + return self.get_collapse_list(self.FULL_METADATA_LINK) + + def get_metadata_dates_list(self) -> Locator: + return self.get_collapse_list(self.METADATA_DATES) diff --git a/playwright/pages/detail_page.py b/playwright/pages/detail_page.py index e3a777e9..30a6c87a 100644 --- a/playwright/pages/detail_page.py +++ b/playwright/pages/detail_page.py @@ -25,9 +25,6 @@ def get_tab_section(self, title: str) -> Locator: def get_not_found_element(self, item: str) -> Locator: return self.get_text(f'{item} Not Found') - def get_collapse_list(self, item_list: str) -> Locator: - return self.page.get_by_test_id(f'collapse-list-{item_list.lower()}') - def click_show_more(self, item_list: str) -> None: self.click_button(f'Show More {item_list}') diff --git a/playwright/pages/search_page.py b/playwright/pages/search_page.py index a35fef30..c331a301 100644 --- a/playwright/pages/search_page.py +++ b/playwright/pages/search_page.py @@ -12,8 +12,15 @@ def __init__(self, page: Page): self.map = Map(page) # Page locators + self.loading = page.get_by_test_id( + 'search-page-result-list' + ).get_by_test_id('loading-progress') self.first_result_title = page.get_by_test_id('result-card-title').first + def wait_for_search_to_complete(self) -> None: + """Wait until the search loading indicator disappears""" + self.loading.wait_for(state='hidden', timeout=5000) + def wait_for_updated_search_result(self) -> None: """Wait until the second search result is detached""" selector = 'div[data-testid="result-card-list"]' @@ -22,4 +29,4 @@ def wait_for_updated_search_result(self) -> None: def click_dataset(self, title: str) -> None: """Click on the given dataset title""" - self.get_button(title, exact=False).click() + self.page.locator('button').filter(has_text=title).click() diff --git a/playwright/tests/detail_page/test_about_tab.py b/playwright/tests/detail_page/test_about_tab.py index c66be4cb..985ee9c8 100644 --- a/playwright/tests/detail_page/test_about_tab.py +++ b/playwright/tests/detail_page/test_about_tab.py @@ -14,15 +14,7 @@ 'Integrated Marine Observing System (IMOS) is enabled by the National Collaborative Research Infrastructure Strategy', 'IMOS Keywords Thesaurus', 'IMOS Facility | Deep Water Moorings', - ), - ( - 'IMOS Bio-Acoustic Ships of Opportunity (BA SOOP) Sub-Facility', - '0015db7e-e684-7548-e053-08114f8cd4ad', - 'CSIRO Oceans & Atmosphere - Hobart - Downie, Ryan', - 'Credits Not Found', - 'AODN Geographic Extent Names', - 'Global / Oceans | Indian', - ), + ) ], ) def test_about_sections( @@ -43,10 +35,12 @@ def test_about_sections( about.keywords.click() detail_page.click_button(keyword) - expect(detail_page.get_text(keyword_value)).to_be_in_viewport() + keywords_list = about.get_keywords_list() + expect(keywords_list.get_by_text(keyword_value)).to_be_in_viewport() about.credits.click() - expect(detail_page.get_text(credit)).to_be_in_viewport() + credits_list = about.get_credits_list() + expect(credits_list.get_by_text(credit)).to_be_in_viewport() about.contacts.click() expect(detail_page.get_button(contact)).to_be_in_viewport() diff --git a/playwright/tests/detail_page/test_associated_records_tab.py b/playwright/tests/detail_page/test_associated_records_tab.py index 296acdc5..532e252b 100644 --- a/playwright/tests/detail_page/test_associated_records_tab.py +++ b/playwright/tests/detail_page/test_associated_records_tab.py @@ -5,15 +5,17 @@ @pytest.mark.parametrize( - 'title, uuid, parent_record, parent_record_value, sibling_records, sibling_records_value', + 'title, uuid, parent_record, parent_record_value, sibling_records, sibling_records_value, child_records, child_records_value', [ ( 'Integrated Marine Observing System (IMOS) - Location of assets', '1fba3a57-35f4-461b-8a0e-551af229714e', 'Integrated Marine Observing System (IMOS)', - 'IMOS is designed to be a fully-integrated, national system', + 'IMOS is designed to be a fully-integrated, national system, observing at ocean-basin', 'IMOS - New Technology Proving - Low Cost Wave Buoys', 'The Low Cost Wave Buoy Technology Sub-Facility', + 'IMOS - Australian National Mooring Network (ANMN) Facility', + 'The Australian National Mooring Network Facility is a series of national reference stations', ), ], ) @@ -25,6 +27,8 @@ def test_associated_records_sections( parent_record_value: str, sibling_records: str, sibling_records_value: str, + child_records: str, + child_records_value: str, ) -> None: detail_page = DetailPage(page_mock) @@ -34,10 +38,24 @@ def test_associated_records_sections( associated_records = detail_page.tabs.associated_records associated_records.tab.click() + associated_records.child_records.click() + page_mock.wait_for_timeout(200) + detail_page.click_button(child_records) + child_records_list = associated_records.get_child_records_list() + expect( + child_records_list.get_by_text(child_records_value) + ).to_be_in_viewport() + associated_records.sibling_records.click() detail_page.click_button(sibling_records) - expect(detail_page.get_text(sibling_records_value)).to_be_in_viewport() + sibling_records_list = associated_records.get_sibling_records_list() + expect( + sibling_records_list.get_by_text(sibling_records_value) + ).to_be_in_viewport() associated_records.parent_record.click() detail_page.click_button(parent_record) - expect(detail_page.get_text(parent_record_value)).to_be_in_viewport() + parent_record_list = associated_records.get_parent_record_list() + expect( + parent_record_list.get_by_text(parent_record_value) + ).to_be_in_viewport() diff --git a/playwright/tests/detail_page/test_citation_tab.py b/playwright/tests/detail_page/test_citation_tab.py index 59cefbde..55fab033 100644 --- a/playwright/tests/detail_page/test_citation_tab.py +++ b/playwright/tests/detail_page/test_citation_tab.py @@ -5,14 +5,15 @@ @pytest.mark.parametrize( - 'title, uuid, constranits_value, suggested_citation_value, license_value', + 'title, uuid, cited_responsible_parties, license, suggested_citation, constranits', [ ( 'Integrated Marine Observing System (IMOS) - Location of assets', '1fba3a57-35f4-461b-8a0e-551af229714e', - 'Use Limitation', - 'The citation in a list of references is: "IMOS [year-of-data-download]', + 'Department of Environment, Land, Water and Planning (DELWP), Victorian Government - Mazor, Tessa', 'Creative Commons Attribution 4.0 International License', + 'The citation in a list of references is: "IMOS [year-of-data-download]', + 'Use Limitation', ), ], ) @@ -20,9 +21,10 @@ def test_citation_sections( page_mock: Page, title: str, uuid: str, - constranits_value: str, - suggested_citation_value: str, - license_value: str, + cited_responsible_parties: str, + license: str, + suggested_citation: str, + constranits: str, ) -> None: detail_page = DetailPage(page_mock) @@ -33,10 +35,23 @@ def test_citation_sections( citation.tab.click() citation.constranits.click() - expect(detail_page.get_text(constranits_value)).to_be_in_viewport() + constranits_list = citation.get_constranits_list() + expect(constranits_list.get_by_text(constranits)).to_be_in_viewport() citation.suggested_citation.click() - expect(detail_page.get_text(suggested_citation_value)).to_be_in_viewport() + suggested_citation_list = citation.get_suggested_citation_list() + expect( + suggested_citation_list.get_by_text(suggested_citation) + ).to_be_in_viewport() citation.license.click() - expect(detail_page.get_text(license_value)).to_be_in_viewport() + license_list = citation.get_license_list() + expect(license_list.get_by_text(license)).to_be_in_viewport() + + citation.cited_responsible_parties.click() + cited_responsible_parties_list = ( + citation.get_cited_responsible_parties_list() + ) + expect( + cited_responsible_parties_list.get_by_text(cited_responsible_parties) + ).to_be_in_viewport() diff --git a/playwright/tests/detail_page/test_detail_page.py b/playwright/tests/detail_page/test_detail_page.py index 94bc6c5f..002e4b4e 100644 --- a/playwright/tests/detail_page/test_detail_page.py +++ b/playwright/tests/detail_page/test_detail_page.py @@ -10,7 +10,6 @@ 'title', [ ('Integrated Marine Observing System (IMOS) - Location of assets'), - ('IMOS Bio-Acoustic Ships of Opportunity (BA SOOP) Sub-Facility'), ], ) def test_tab_panel_scroll(page_mock: Page, title: str) -> None: @@ -20,12 +19,12 @@ def test_tab_panel_scroll(page_mock: Page, title: str) -> None: landing_page.load() landing_page.search.click_search_button() - page_mock.wait_for_timeout(2000) + search_page.wait_for_search_to_complete() search_page.click_dataset(title) - expect(detail_page.page_title).to_have_text(title) + detail_page.tabs.scroll_right() - expect(detail_page.tabs.global_attr.tab).to_be_in_viewport() + expect(detail_page.tabs.associated_records.tab).to_be_in_viewport() detail_page.tabs.scroll_left() expect(detail_page.tabs.abstract.tab).to_be_in_viewport() @@ -33,12 +32,6 @@ def test_tab_panel_scroll(page_mock: Page, title: str) -> None: @pytest.mark.parametrize( 'title, uuid, tab, not_found_item', [ - ( - 'Integrated Marine Observing System (IMOS) - Location of assets', - '1fba3a57-35f4-461b-8a0e-551af229714e', - 'Metadata Information', - 'Metadata Link', - ), ( 'IMOS Bio-Acoustic Ships of Opportunity (BA SOOP) Sub-Facility', '0015db7e-e684-7548-e053-08114f8cd4ad', @@ -116,7 +109,7 @@ def test_show_more_and_less_list_items( expect(detail_page.page_title).to_have_text(title) detail_page.click_tab(tab) - keywords = detail_page.get_collapse_list(item_list) + keywords = detail_page.get_collapse_list_items(item_list) initial_count = keywords.count() detail_page.click_show_more(item_list) diff --git a/playwright/tests/detail_page/test_metadata_info_tab.py b/playwright/tests/detail_page/test_metadata_info_tab.py index 1d2faed1..e2372bad 100644 --- a/playwright/tests/detail_page/test_metadata_info_tab.py +++ b/playwright/tests/detail_page/test_metadata_info_tab.py @@ -5,13 +5,14 @@ @pytest.mark.parametrize( - 'title, uuid, metadata_contact, metadata_identifier, metadata_dates', + 'title, uuid, metadata_contact, metadata_identifier, full_metadata_link, metadata_dates', [ ( 'Integrated Marine Observing System (IMOS) - Location of assets', '1fba3a57-35f4-461b-8a0e-551af229714e', 'Integrated Marine Observing System (IMOS)', '1fba3a57-35f4-461b-8a0e-551af229714e', + 'https://metadata.imas.utas.edu.au/geonetwork/srv/eng/catalog.search', 'CREATION: Thu Jul 09 2020 15:40:31 GMT+0000', ), ], @@ -22,6 +23,7 @@ def test_metadata_info_sections( uuid: str, metadata_contact: str, metadata_identifier: str, + full_metadata_link: str, metadata_dates: str, ) -> None: detail_page = DetailPage(page_mock) @@ -32,11 +34,21 @@ def test_metadata_info_sections( metadata_info.tab.click() metadata_info.metadata_dates.click() - expect(detail_page.get_text(metadata_dates)).to_be_in_viewport() + metadata_dates_list = metadata_info.get_metadata_dates_list() + expect(metadata_dates_list.get_by_text(metadata_dates)).to_be_in_viewport() + + metadata_info.full_metadata_link.click() + full_metadata_link_list = metadata_info.get_full_metadata_link_list() + expect( + full_metadata_link_list.get_by_role('link', name=full_metadata_link) + ).to_be_in_viewport() metadata_info.metadata_identifier.click() - expect(detail_page.get_text(metadata_identifier)).to_be_in_viewport() + metadata_identifier_list = metadata_info.get_metadata_identifier_list() + expect( + metadata_identifier_list.get_by_text(metadata_identifier) + ).to_be_in_viewport() metadata_info.metadata_contact.click() - expect(metadata_info.meradata_contact_title).to_be_in_viewport() - expect(metadata_info.meradata_contact_title).to_have_text(metadata_contact) + expect(metadata_info.metadata_contact_title).to_be_in_viewport() + expect(metadata_info.metadata_contact_title).to_have_text(metadata_contact) diff --git a/playwright/tests/search/test_map.py b/playwright/tests/search/test_map.py index 1acebf97..c4a21820 100644 --- a/playwright/tests/search/test_map.py +++ b/playwright/tests/search/test_map.py @@ -13,9 +13,6 @@ def test_map_drag_updates_search_results(page_mock: Page) -> None: - - # TODO: ignore this test for now - pytest.skip('Test not implemented yet') api_router = ApiRouter(page=page_mock) landing_page = LandingPage(page_mock) search_page = SearchPage(page_mock) @@ -23,6 +20,7 @@ def test_map_drag_updates_search_results(page_mock: Page) -> None: landing_page.load() landing_page.search.fill_search_text('imos') landing_page.search.click_search_button() + search_page.wait_for_search_to_complete() initial_data = search_page.first_result_title.inner_text() # Change api route to get updated response after the map drag event @@ -33,8 +31,7 @@ def test_map_drag_updates_search_results(page_mock: Page) -> None: search_page.wait_for_updated_search_result() updated_data = search_page.first_result_title.inner_text() - # TODO: fix it later. after adding loading modal, this test still need to be fixed - # assert initial_data != updated_data + assert initial_data != updated_data @pytest.mark.parametrize( @@ -50,15 +47,13 @@ def test_map_drag_updates_search_results(page_mock: Page) -> None: def test_map_datapoint_hover_and_click( page_mock: Page, title: str, lng: str, lat: str ) -> None: - - # TODO: ignore this test for now - pytest.skip('Test not implemented yet') landing_page = LandingPage(page_mock) search_page = SearchPage(page_mock) landing_page.load() landing_page.search.fill_search_text('imos') landing_page.search.click_search_button() + search_page.wait_for_search_to_complete() search_page.map.center_map(lng, lat) search_page.map.hover_map() @@ -76,9 +71,6 @@ def test_map_datapoint_hover_and_click( def test_map_updates_on_search_change( page_mock: Page, search_text: str, updated_search_text: str ) -> None: - - # TODO: ignore this test for now - pytest.skip('Test not implemented yet') api_router = ApiRouter(page=page_mock) landing_page = LandingPage(page_mock) search_page = SearchPage(page_mock) @@ -86,6 +78,7 @@ def test_map_updates_on_search_change( landing_page.load() landing_page.search.fill_search_text(search_text) landing_page.search.click_search_button() + search_page.wait_for_search_to_complete() expect(search_page.first_result_title).to_be_visible() map_layers = search_page.map.get_map_layers() @@ -117,9 +110,6 @@ def test_map_updates_on_search_change( def test_map_base_layers( page_mock: Page, layer_text: str, layer_type: LayerType ) -> None: - - # TODO: ignore this test for now - pytest.skip('Test not implemented yet') landing_page = LandingPage(page_mock) search_page = SearchPage(page_mock) @@ -127,6 +117,7 @@ def test_map_base_layers( landing_page.load() landing_page.search.click_search_button() + search_page.wait_for_search_to_complete() expect(search_page.first_result_title).to_be_visible() search_page.map.basemap_show_hide_menu.click() @@ -158,15 +149,13 @@ def test_map_spider( data_lng: str, data_lat: str, ) -> None: - - # TODO: ignore this test for now - pytest.skip('Test not implemented yet') landing_page = LandingPage(page_mock) search_page = SearchPage(page_mock) landing_page.load() landing_page.search.fill_search_text('imos') landing_page.search.click_search_button() + search_page.wait_for_search_to_complete() search_page.map.center_map(head_lng, head_lat) search_page.map.hover_map() diff --git a/playwright/tests/search/test_search.py b/playwright/tests/search/test_search.py index 47032526..b99ea2df 100644 --- a/playwright/tests/search/test_search.py +++ b/playwright/tests/search/test_search.py @@ -15,8 +15,6 @@ def test_basic_search( page_mock: Page, search_text: str, category_name: str ) -> None: - # TODO: ignore this test for now - pytest.skip('Test not implemented yet') landing_page = LandingPage(page_mock) search_page = SearchPage(page_mock) @@ -25,5 +23,6 @@ def test_basic_search( expect(landing_page.get_option(category_name)).to_be_visible() landing_page.click_option(category_name) landing_page.search.click_search_button() + expect(search_page.search.search_field).to_have_value(category_name) expect(search_page.first_result_title).to_be_visible() diff --git a/src/components/list/CollapseList.tsx b/src/components/list/CollapseList.tsx index 379109b9..7505224a 100644 --- a/src/components/list/CollapseList.tsx +++ b/src/components/list/CollapseList.tsx @@ -7,26 +7,19 @@ interface CollapseListProps { title: string; items: { title: string; content: string[] }[]; areAllOpen?: boolean; - testId?: string; } const CollapseList: React.FC = ({ title, items, areAllOpen = false, - testId, }) => { // children list const collapseComponents: ReactNode[] = useMemo(() => { const returnedList: ReactNode[] = []; items?.map((item, index) => { returnedList.push( - + {item.content?.map((content, index) => ( ))} diff --git a/src/components/list/ExpandableList.tsx b/src/components/list/ExpandableList.tsx index d1de5131..699de359 100644 --- a/src/components/list/ExpandableList.tsx +++ b/src/components/list/ExpandableList.tsx @@ -39,7 +39,7 @@ const ExpandableList: React.FC = ({ {!childrenList || childrenList.length === 0 ? ( ) : ( - + {childrenList.map((child) => { showingCollapseCount++; if (!isShowingMore && showingCollapseCount > 5) { diff --git a/src/components/list/listItem/CollapseItem.tsx b/src/components/list/listItem/CollapseItem.tsx index 8e93b467..14e4f5e8 100644 --- a/src/components/list/listItem/CollapseItem.tsx +++ b/src/components/list/listItem/CollapseItem.tsx @@ -12,7 +12,6 @@ interface CollapseFrameProps { isAssociatedRecord?: boolean; isOpen?: boolean; email?: string; - testId?: string; } const CollapseItem: React.FC = ({ @@ -22,7 +21,6 @@ const CollapseItem: React.FC = ({ isAssociatedRecord = false, isOpen = false, email, - testId, }) => { const [isExpanded, setIsExpanded] = useState(isOpen); @@ -42,7 +40,6 @@ const CollapseItem: React.FC = ({ sx={{ alignSelf: "center", }} - data-testid={testId} > { diff --git a/src/pages/detail-page/subpages/tab-panels/AboutPanel.tsx b/src/pages/detail-page/subpages/tab-panels/AboutPanel.tsx index 3e5de3ff..aceb252c 100644 --- a/src/pages/detail-page/subpages/tab-panels/AboutPanel.tsx +++ b/src/pages/detail-page/subpages/tab-panels/AboutPanel.tsx @@ -73,13 +73,7 @@ const AboutPanel = () => { }, { title: "Keywords", - component: ( - - ), + component: , }, ], [aboutContacts, credits, keywords] From 64520da96b249e04a167ad0f0be67fbe275d7484 Mon Sep 17 00:00:00 2001 From: AR-RIFAT Date: Tue, 17 Sep 2024 19:45:07 +1000 Subject: [PATCH 3/5] :white_check_mark: update detail page tests --- playwright/pages/detail_page.py | 4 ++-- playwright/pages/search_page.py | 15 ++++++++++++++- playwright/tests/detail_page/test_links_tab.py | 5 +++-- .../list/listItem/subitem/ContactArea.tsx | 6 +++--- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/playwright/pages/detail_page.py b/playwright/pages/detail_page.py index 30a6c87a..65a428af 100644 --- a/playwright/pages/detail_page.py +++ b/playwright/pages/detail_page.py @@ -26,7 +26,7 @@ def get_not_found_element(self, item: str) -> Locator: return self.get_text(f'{item} Not Found') def click_show_more(self, item_list: str) -> None: - self.click_button(f'Show More {item_list}') + self.page.get_by_test_id(f'show-more-detail-btn-{item_list}').click() def click_show_less(self, item_list: str) -> None: - self.click_button(f'Show Less {item_list}') + self.page.get_by_test_id(f'show-less-detail-btn-{item_list}').click() diff --git a/playwright/pages/search_page.py b/playwright/pages/search_page.py index c331a301..84a32e1d 100644 --- a/playwright/pages/search_page.py +++ b/playwright/pages/search_page.py @@ -18,9 +18,22 @@ def __init__(self, page: Page): self.first_result_title = page.get_by_test_id('result-card-title').first def wait_for_search_to_complete(self) -> None: - """Wait until the search loading indicator disappears""" + """ + Waits for the search loading indicator to disappear, handling the case + where it may appear twice. This function waits for the indicator to + become hidden, and if it reappears, it waits again until it disappears. + """ self.loading.wait_for(state='hidden', timeout=5000) + # Handle the case when loading indicator appears twice + try: + self.loading.wait_for(state='visible', timeout=5000) + self.loading.wait_for(state='hidden', timeout=5000) + except TimeoutError: + # If the loading indicator doesn't reappear within the timeout, + # assume the search is complete and ignore the exception. + pass + def wait_for_updated_search_result(self) -> None: """Wait until the second search result is detached""" selector = 'div[data-testid="result-card-list"]' diff --git a/playwright/tests/detail_page/test_links_tab.py b/playwright/tests/detail_page/test_links_tab.py index ff678782..e2e4fe59 100644 --- a/playwright/tests/detail_page/test_links_tab.py +++ b/playwright/tests/detail_page/test_links_tab.py @@ -33,5 +33,6 @@ def test_links_sections( link_card.hover() expect(links.copy_link_button).to_be_visible() - expect(link_card.get_by_text(link_title)).to_be_visible() - expect(link_card.get_by_role('link', name=link_href)).to_be_visible() + link = link_card.get_by_role('link', name=link_title) + expect(link).to_be_in_viewport() + assert link.get_attribute('href') == link_href diff --git a/src/components/list/listItem/subitem/ContactArea.tsx b/src/components/list/listItem/subitem/ContactArea.tsx index e82e2758..a75e3311 100644 --- a/src/components/list/listItem/subitem/ContactArea.tsx +++ b/src/components/list/listItem/subitem/ContactArea.tsx @@ -41,7 +41,7 @@ const ContactArea: React.FC = ({ contact }) => { - + {!delivery_point && !city && !country && @@ -81,7 +81,7 @@ const ContactArea: React.FC = ({ contact }) => { )} - + {(!phones || phones.length === 0) && ( [NO CONTACT] @@ -108,7 +108,7 @@ const ContactArea: React.FC = ({ contact }) => { - + From f64b1df1a25eafc06f4d18c18680637a5ef59aad Mon Sep 17 00:00:00 2001 From: AR-RIFAT Date: Wed, 18 Sep 2024 10:56:52 +1000 Subject: [PATCH 4/5] :bulb: updated comments --- playwright/pages/components/tab_container.py | 2 +- playwright/pages/components/tabs/abstract.py | 8 ++++++-- playwright/pages/components/tabs/global_attr.py | 4 +++- playwright/pages/components/tabs/lineage.py | 4 +++- playwright/pages/components/tabs/links.py | 4 +++- playwright/tests/search/test_search.py | 1 + 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/playwright/pages/components/tab_container.py b/playwright/pages/components/tab_container.py index cfeab309..1ffcbd65 100644 --- a/playwright/pages/components/tab_container.py +++ b/playwright/pages/components/tab_container.py @@ -15,7 +15,7 @@ class TabContainerComponent(BasePage): def __init__(self, page: Page): self.page = page - # Page locators + # Tabs self.abstract = AbstractTab(page) self.about = AboutTab(page) self.links = LinksTab(page) diff --git a/playwright/pages/components/tabs/abstract.py b/playwright/pages/components/tabs/abstract.py index fc7d3038..23e6ef18 100644 --- a/playwright/pages/components/tabs/abstract.py +++ b/playwright/pages/components/tabs/abstract.py @@ -4,9 +4,13 @@ class AbstractTab(BasePage): + TAB_NAME = 'Abstract' + def __init__(self, page: Page): self.page = page # Page locators - self.tab = self.get_tab('Abstract') - self.map = page.get_by_label('Abstract').get_by_label('Map', exact=True) + self.tab = self.get_tab(self.TAB_NAME) + self.map = page.get_by_label(self.TAB_NAME).get_by_label( + 'Map', exact=True + ) diff --git a/playwright/pages/components/tabs/global_attr.py b/playwright/pages/components/tabs/global_attr.py index 85863461..f65aecf1 100644 --- a/playwright/pages/components/tabs/global_attr.py +++ b/playwright/pages/components/tabs/global_attr.py @@ -4,8 +4,10 @@ class GlobalAttrTab(BasePage): + TAB_NAME = 'Global Attribute' + def __init__(self, page: Page): self.page = page # Page locators - self.tab = self.get_tab('Global Attribute') + self.tab = self.get_tab(self.TAB_NAME) diff --git a/playwright/pages/components/tabs/lineage.py b/playwright/pages/components/tabs/lineage.py index 63f4f00e..636ccb45 100644 --- a/playwright/pages/components/tabs/lineage.py +++ b/playwright/pages/components/tabs/lineage.py @@ -4,8 +4,10 @@ class LineageTab(BasePage): + TAB_NAME = 'Lineage' + def __init__(self, page: Page): self.page = page # Page locators - self.tab = self.get_tab('Lineage') + self.tab = self.get_tab(self.TAB_NAME) diff --git a/playwright/pages/components/tabs/links.py b/playwright/pages/components/tabs/links.py index 4231c81b..cabaaf9b 100644 --- a/playwright/pages/components/tabs/links.py +++ b/playwright/pages/components/tabs/links.py @@ -4,10 +4,12 @@ class LinksTab(BasePage): + TAB_NAME = 'Links' + def __init__(self, page: Page): self.page = page # Page locators - self.tab = self.get_tab('Links') + self.tab = self.get_tab(self.TAB_NAME) self.link_cards = page.get_by_test_id('links-card') self.copy_link_button = self.get_button('Copy Link') diff --git a/playwright/tests/search/test_search.py b/playwright/tests/search/test_search.py index b99ea2df..5badf7ef 100644 --- a/playwright/tests/search/test_search.py +++ b/playwright/tests/search/test_search.py @@ -23,6 +23,7 @@ def test_basic_search( expect(landing_page.get_option(category_name)).to_be_visible() landing_page.click_option(category_name) landing_page.search.click_search_button() + search_page.wait_for_search_to_complete() expect(search_page.search.search_field).to_have_value(category_name) expect(search_page.first_result_title).to_be_visible() From f2c8dbb8f4394061151f697731244d47918d70eb Mon Sep 17 00:00:00 2001 From: AR-RIFAT Date: Thu, 19 Sep 2024 10:59:17 +1000 Subject: [PATCH 5/5] :white_check_mark: updated comments and search wait timeout --- playwright/pages/base_page.py | 2 ++ playwright/pages/detail_page.py | 3 +++ playwright/pages/search_page.py | 8 ++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/playwright/pages/base_page.py b/playwright/pages/base_page.py index b16c73f7..d8306408 100644 --- a/playwright/pages/base_page.py +++ b/playwright/pages/base_page.py @@ -54,7 +54,9 @@ def click_heading(self, text: str) -> None: self.get_heading(text).click() def get_collapse_list(self, item_list: str) -> Locator: + """Returns collapse list container element""" return self.page.get_by_test_id(f'collapse-list-{item_list}') def get_collapse_list_items(self, item_list: str) -> Locator: + """Returns the given collapse list items""" return self.get_collapse_list(item_list).get_by_test_id('collapseItem') diff --git a/playwright/pages/detail_page.py b/playwright/pages/detail_page.py index 65a428af..c10a1b4f 100644 --- a/playwright/pages/detail_page.py +++ b/playwright/pages/detail_page.py @@ -16,13 +16,16 @@ def __init__(self, page: Page): self.page_title = self.get_label(text='collection title') def load(self, uuid: str) -> None: + """Load the detail page for the given uuid""" url = f'{settings.baseURL}/details?uuid={uuid}' self.page.goto(url, timeout=90 * 1000) def get_tab_section(self, title: str) -> Locator: + """Returns tab section title element""" return self.page.get_by_test_id(f'detail-sub-section-{title}') def get_not_found_element(self, item: str) -> Locator: + """Returns the given item not found element""" return self.get_text(f'{item} Not Found') def click_show_more(self, item_list: str) -> None: diff --git a/playwright/pages/search_page.py b/playwright/pages/search_page.py index 84a32e1d..f3568d7d 100644 --- a/playwright/pages/search_page.py +++ b/playwright/pages/search_page.py @@ -1,4 +1,4 @@ -from playwright.sync_api import Page +from playwright.sync_api import Page, TimeoutError from pages.base_page import BasePage from pages.components.map import Map @@ -23,12 +23,12 @@ def wait_for_search_to_complete(self) -> None: where it may appear twice. This function waits for the indicator to become hidden, and if it reappears, it waits again until it disappears. """ - self.loading.wait_for(state='hidden', timeout=5000) + self.loading.wait_for(state='hidden', timeout=20 * 1000) # Handle the case when loading indicator appears twice try: - self.loading.wait_for(state='visible', timeout=5000) - self.loading.wait_for(state='hidden', timeout=5000) + self.loading.wait_for(state='visible', timeout=1000) + self.loading.wait_for(state='hidden', timeout=20 * 1000) except TimeoutError: # If the loading indicator doesn't reappear within the timeout, # assume the search is complete and ignore the exception.