diff --git a/src/explore-education-statistics-admin/src/pages/publication/components/ReleaseSeriesTable.tsx b/src/explore-education-statistics-admin/src/pages/publication/components/ReleaseSeriesTable.tsx index bcdc478eea9..7fe5f8a361b 100644 --- a/src/explore-education-statistics-admin/src/pages/publication/components/ReleaseSeriesTable.tsx +++ b/src/explore-education-statistics-admin/src/pages/publication/components/ReleaseSeriesTable.tsx @@ -72,7 +72,7 @@ export default function ReleaseSeriesTable({ } return ( -
Description | diff --git a/tests/robot-tests/tests/admin_and_public/bau/legacy_releases_reordering.robot b/tests/robot-tests/tests/admin_and_public/bau/legacy_releases_reordering.robot index 636fd0c172f..11e7a1a6737 100644 --- a/tests/robot-tests/tests/admin_and_public/bau/legacy_releases_reordering.robot +++ b/tests/robot-tests/tests/admin_and_public/bau/legacy_releases_reordering.robot @@ -12,13 +12,16 @@ Test Setup fail test fast if required *** Variables *** -${RELEASE_NAME}= Academic year Q1 2022/23 -${PUBLICATION_NAME}= UI tests - legacy releases-%{RUN_IDENTIFIER} -${PUBLICATION_SLUG}= ui-tests-legacy-releases-%{RUN_IDENTIFIER} -${PUBLIC_PUBLICATION_URL_ENDING}= /find-statistics/${PUBLICATION_SLUG} -${DESCRIPTION}= legacy release description -${UPDATED_DESCRIPTION}= updated legacy release description -${PUBLIC_URL_WITHOUT_AUTH} ${EMPTY} +${PUBLICATION_NAME}= UI tests - legacy releases %{RUN_IDENTIFIER} +${PUBLICATION_SLUG}= ui-tests-legacy-releases-%{RUN_IDENTIFIER} +${RELEASE_1_NAME}= Academic year 2020/21 +${RELEASE_2_NAME}= Academic year Q1 2022/23 +${LEGACY_RELEASE_1_DESCRIPTION}= legacy release 1 +${LEGACY_RELEASE_1_URL}= http://test.url/1 +${LEGACY_RELEASE_1_DESCRIPTION_UPDATED}= legacy release 1 updated +${LEGACY_RELEASE_1_URL_UPDATED}= http://test.url/1/updated +${LEGACY_RELEASE_2_DESCRIPTION}= legacy release 2 +${LEGACY_RELEASE_2_URL}= http://test.url/2 *** Test Cases *** @@ -26,231 +29,373 @@ Create new publication via api ${PUBLICATION_ID}= user creates test publication via api ${PUBLICATION_NAME} set suite variable ${PUBLICATION_ID} -Validate that legacy releases do not exist +Validate publication release order table is empty user navigates to publication page from dashboard ${PUBLICATION_NAME} user clicks link Legacy releases user waits until h2 is visible Legacy releases - user checks page does not contain element css:tbody[data-rfd-droppable-id="droppable"] + user checks page contains No releases for this publication. -Create legacy release +Create first legacy release user navigates to publication page from dashboard ${PUBLICATION_NAME} user clicks link Legacy releases user waits until h2 is visible Legacy releases - user creates legacy release ${DESCRIPTION} http://test.com + user creates legacy release ${LEGACY_RELEASE_1_DESCRIPTION} ${LEGACY_RELEASE_1_URL} -Create new release via api - user navigates to publication page from dashboard ${PUBLICATION_NAME} +Validate publication release order table headings + user checks table column heading contains 1 1 Description testid:release-series + user checks table column heading contains 1 2 URL testid:release-series + user checks table column heading contains 1 3 Status testid:release-series + user checks table column heading contains 1 4 Actions testid:release-series + +Validate first legacy release exists in the publication release order + user checks table body has x rows 1 testid:release-series + + user checks table cell contains 1 1 ${LEGACY_RELEASE_1_DESCRIPTION} + user checks table cell contains 1 2 ${LEGACY_RELEASE_1_URL} + user checks table cell contains 1 3 Legacy release + user checks table cell contains 1 4 Edit + user checks table cell contains 1 4 Delete + +Create first release via api user creates test release via api ${PUBLICATION_ID} AY 2020 -Create 2nd legacy release - user navigates to publication page from dashboard ${PUBLICATION_NAME} - user clicks link Legacy releases - user waits until h2 is visible Legacy releases - user creates legacy release ${DESCRIPTION} http://test.com + ${PUBLIC_URL_WITHOUT_AUTH}= remove auth from url %{PUBLIC_URL} + set suite variable ${PUBLIC_URL_WITHOUT_AUTH} + set suite variable ${PUBLIC_RELEASE_1_URL} + ... ${PUBLIC_URL_WITHOUT_AUTH}/find-statistics/${PUBLICATION_SLUG}/2020-21 -Validate that publication and legacy releases exist in the page +Validate first release exists in the publication release order with status unpublished user navigates to publication page from dashboard ${PUBLICATION_NAME} user clicks link Legacy releases user waits until h2 is visible Legacy releases + user checks table body has x rows 2 testid:release-series - ${PUBLIC_URL_WITHOUT_AUTH}= remove auth from url %{PUBLIC_URL} - set suite variable ${PUBLIC_URL_WITHOUT_AUTH} + user checks table cell contains 1 1 ${RELEASE_1_NAME} + user checks table cell contains 1 2 ${PUBLIC_RELEASE_1_URL} + user checks table cell contains 1 3 Unpublished - user checks table cell contains 1 1 Academic year 2020/21 - user checks table cell contains 1 2 ${PUBLIC_URL_WITHOUT_AUTH}/find-statistics/${PUBLICATION_SLUG}/2020-21 + user checks table cell contains 2 1 ${LEGACY_RELEASE_1_DESCRIPTION} + user checks table cell contains 2 2 ${LEGACY_RELEASE_1_URL} + user checks table cell contains 2 3 Legacy release + user checks table cell contains 2 4 Edit + user checks table cell contains 2 4 Delete + +Create second legacy release + user creates legacy release ${LEGACY_RELEASE_2_DESCRIPTION} ${LEGACY_RELEASE_2_URL} + +Validate second legacy release exists in the publication release order + user checks table body has x rows 3 testid:release-series + + user checks table cell contains 1 1 ${RELEASE_1_NAME} + user checks table cell contains 1 2 ${PUBLIC_RELEASE_1_URL} user checks table cell contains 1 3 Unpublished - user checks table cell contains 2 1 ${DESCRIPTION} - user checks table cell contains 2 2 http://test.com + user checks table cell contains 2 1 ${LEGACY_RELEASE_1_DESCRIPTION} + user checks table cell contains 2 2 ${LEGACY_RELEASE_1_URL} user checks table cell contains 2 3 Legacy release user checks table cell contains 2 4 Edit user checks table cell contains 2 4 Delete - user checks table cell contains 3 1 ${DESCRIPTION} - user checks table cell contains 3 2 http://test.com + user checks table cell contains 3 1 ${LEGACY_RELEASE_2_DESCRIPTION} + user checks table cell contains 3 2 ${LEGACY_RELEASE_2_URL} user checks table cell contains 3 3 Legacy release user checks table cell contains 3 4 Edit user checks table cell contains 3 4 Delete -Navigate to release in admin +Add headline text block to first release content page user navigates to draft release page from dashboard ${PUBLICATION_NAME} - ... Academic year 2020/21 - -Add headline text block to Content page + ... ${RELEASE_1_NAME} user navigates to content page ${PUBLICATION_NAME} user adds headlines text block user adds content to headlines text block Headline text block text -Approve release +Approve first release user clicks link Sign off - sleep 1 user approves original release for immediate publication - user waits until page contains element testid:public-release-url - ${PUBLIC_RELEASE_LINK}= get value xpath://*[@data-testid="public-release-url"] - check that variable is not empty PUBLIC_RELEASE_LINK ${PUBLIC_RELEASE_LINK} - set suite variable ${PUBLIC_RELEASE_LINK} -Check legacy release appears on public frontend - user navigates to public frontend ${PUBLIC_RELEASE_LINK} - user opens details dropdown View releases (2) +Validate first release has latest release status in publication release order + user navigates to publication page from dashboard ${PUBLICATION_NAME} + user clicks link Legacy releases + user waits until h2 is visible Legacy releases + + user checks table body has x rows 3 testid:release-series + + user checks table cell contains 1 1 ${RELEASE_1_NAME} + user checks table cell contains 1 2 ${PUBLIC_RELEASE_1_URL} + user checks table cell contains 1 3 Latest release + + user checks table cell contains 2 1 ${LEGACY_RELEASE_1_DESCRIPTION} + user checks table cell contains 2 2 ${LEGACY_RELEASE_1_URL} + user checks table cell contains 2 3 Legacy release + user checks table cell contains 2 4 Edit + user checks table cell contains 2 4 Delete + + user checks table cell contains 3 1 ${LEGACY_RELEASE_2_DESCRIPTION} + user checks table cell contains 3 2 ${LEGACY_RELEASE_2_URL} + user checks table cell contains 3 3 Legacy release + user checks table cell contains 3 4 Edit + user checks table cell contains 3 4 Delete + +Validate other releases section on public frontend + user navigates to public frontend ${PUBLIC_RELEASE_1_URL} + user checks number of other releases is correct 2 + ${view_releases}= user opens details dropdown View releases (2) - ${other_releases}= user gets details content element View releases (2) + user checks other release is shown in position ${LEGACY_RELEASE_1_DESCRIPTION} 1 + user checks other release is shown in position ${LEGACY_RELEASE_2_DESCRIPTION} 2 - user checks list has x items css:ul 2 ${other_releases} + user checks page contains link with text and url + ... ${LEGACY_RELEASE_1_DESCRIPTION} + ... ${LEGACY_RELEASE_1_URL} + ... ${view_releases} - ${other_release_1}= user gets list item element css:ul 2 ${other_releases} - ${other_release_1_link}= get child element ${other_release_1} link:${DESCRIPTION} - user checks element attribute value should be ${other_release_1_link} href http://test.com/ + user checks page contains link with text and url + ... ${LEGACY_RELEASE_2_DESCRIPTION} + ... ${LEGACY_RELEASE_2_URL} + ... ${view_releases} -Navigate to publication to update legacy releases +Update first legacy release user navigates to publication page from dashboard ${PUBLICATION_NAME} user clicks link Legacy releases user waits until h2 is visible Legacy releases -Update legacy release user clicks element xpath://tr[2]//*[text()="Edit"] ${modal}= user waits until modal is visible Edit legacy release user clicks button OK ${modal} user waits until page contains element id:releaseSeriesLegacyLinkForm-description - user enters text into element id:releaseSeriesLegacyLinkForm-description ${UPDATED_DESCRIPTION} - user enters text into element id:releaseSeriesLegacyLinkForm-url http://test2.com + user enters text into element id:releaseSeriesLegacyLinkForm-description + ... ${LEGACY_RELEASE_1_DESCRIPTION_UPDATED} + user enters text into element id:releaseSeriesLegacyLinkForm-url ${LEGACY_RELEASE_1_URL_UPDATED} user clicks button Save legacy release -Validate the updated legacy release +Validate the first legacy release is updated user waits until h2 is visible Legacy releases - user checks element count is x css:tbody tr 3 - user checks table cell contains 2 1 ${UPDATED_DESCRIPTION} - user checks table cell contains 2 2 http://test2.com + user checks table body has x rows 3 testid:release-series + + user checks table cell contains 1 1 ${RELEASE_1_NAME} + user checks table cell contains 1 2 ${PUBLIC_RELEASE_1_URL} + user checks table cell contains 1 3 Latest release + + user checks table cell contains 2 1 ${LEGACY_RELEASE_1_DESCRIPTION_UPDATED} + user checks table cell contains 2 2 ${LEGACY_RELEASE_1_URL_UPDATED} user checks table cell contains 2 3 Legacy release user checks table cell contains 2 4 Edit user checks table cell contains 2 4 Delete -Reorder the legacy releases + user checks table cell contains 3 1 ${LEGACY_RELEASE_2_DESCRIPTION} + user checks table cell contains 3 2 ${LEGACY_RELEASE_2_URL} + user checks table cell contains 3 3 Legacy release + user checks table cell contains 3 4 Edit + user checks table cell contains 3 4 Delete + +Reorder the publication releases user clicks button Reorder releases - user waits until modal is visible Reorder releases - user clicks button OK - user waits until modal is not visible Reorder legacy releases + ${modal}= user waits until modal is visible Reorder releases + user clicks button OK ${modal} + user waits until modal is not visible Reorder releases user waits until page contains button Confirm order + + click element xpath://div[text()="${RELEASE_1_NAME}"] CTRL user presses keys ${SPACE} user presses keys ARROW_DOWN user presses keys ARROW_DOWN user presses keys ${SPACE} + + click element xpath://div[text()="${LEGACY_RELEASE_2_DESCRIPTION}"] CTRL + user presses keys ${SPACE} + user presses keys ARROW_UP + user presses keys ${SPACE} + user clicks button Confirm order sleep 2 -Validate reordered legacy releases +Validate reordered publication releases user waits until page contains button Reorder releases - user checks element count is x css:tbody tr 3 + user checks table body has x rows 3 testid:release-series - user checks table cell contains 1 1 ${UPDATED_DESCRIPTION} - user checks table cell contains 1 2 http://test2.com + user checks table cell contains 1 1 ${LEGACY_RELEASE_2_DESCRIPTION} + user checks table cell contains 1 2 ${LEGACY_RELEASE_2_URL} user checks table cell contains 1 3 Legacy release user checks table cell contains 1 4 Edit user checks table cell contains 1 4 Delete - user checks table cell contains 2 1 ${DESCRIPTION} - user checks table cell contains 2 2 http://test.com + user checks table cell contains 2 1 ${LEGACY_RELEASE_1_DESCRIPTION_UPDATED} + user checks table cell contains 2 2 ${LEGACY_RELEASE_1_URL_UPDATED} user checks table cell contains 2 3 Legacy release user checks table cell contains 2 4 Edit user checks table cell contains 2 4 Delete - user checks table cell contains 3 1 Academic year 2020/21 - user checks table cell contains 3 2 ${PUBLIC_RELEASE_LINK} + user checks table cell contains 3 1 ${RELEASE_1_NAME} + user checks table cell contains 3 2 ${PUBLIC_RELEASE_1_URL} user checks table cell contains 3 3 Latest release -Create a second draft release via api +Validate other releases section on public frontend includes updated legacy release with expected order + user navigates to public frontend ${PUBLIC_RELEASE_1_URL} + user checks number of other releases is correct 2 + ${view_releases}= user opens details dropdown View releases (2) + + user checks other release is shown in position ${LEGACY_RELEASE_2_DESCRIPTION} 1 + user checks other release is shown in position ${LEGACY_RELEASE_1_DESCRIPTION_UPDATED} 2 + + user checks page contains link with text and url + ... ${LEGACY_RELEASE_1_DESCRIPTION_UPDATED} + ... ${LEGACY_RELEASE_1_URL_UPDATED} + ... ${view_releases} + + user checks page contains link with text and url + ... ${LEGACY_RELEASE_2_DESCRIPTION} + ... ${LEGACY_RELEASE_2_URL} + ... ${view_releases} + +Create second release via api + user creates test release via api ${PUBLICATION_ID} AYQ1 2022 + set suite variable ${PUBLIC_RELEASE_2_URL} + ... ${PUBLIC_URL_WITHOUT_AUTH}/find-statistics/${PUBLICATION_SLUG}/2022-23-q1 + +Validate second release exists in the publication release order with status unpublished user navigates to publication page from dashboard ${PUBLICATION_NAME} - user creates release from publication page ${PUBLICATION_NAME} Academic year Q1 2022 + user clicks link Legacy releases + user waits until h2 is visible Legacy releases + user checks table body has x rows 4 testid:release-series + + user checks table cell contains 1 1 ${RELEASE_2_NAME} + user checks table cell contains 1 2 ${PUBLIC_RELEASE_2_URL} + user checks table cell contains 1 3 Unpublished + + user checks table cell contains 2 1 ${LEGACY_RELEASE_2_DESCRIPTION} + user checks table cell contains 2 2 ${LEGACY_RELEASE_2_URL} + user checks table cell contains 2 3 Legacy release + user checks table cell contains 2 4 Edit + user checks table cell contains 2 4 Delete + + user checks table cell contains 3 1 ${LEGACY_RELEASE_1_DESCRIPTION_UPDATED} + user checks table cell contains 3 2 ${LEGACY_RELEASE_1_URL_UPDATED} + user checks table cell contains 3 3 Legacy release + user checks table cell contains 3 4 Edit + user checks table cell contains 3 4 Delete + + user checks table cell contains 4 1 ${RELEASE_1_NAME} + user checks table cell contains 4 2 ${PUBLIC_RELEASE_1_URL} + user checks table cell contains 4 3 Latest release -Add headline text block to content page(2nd release) +Add headline text block to second release content page + user navigates to draft release page from dashboard ${PUBLICATION_NAME} + ... ${RELEASE_2_NAME} user navigates to content page ${PUBLICATION_NAME} user adds headlines text block user adds content to headlines text block Headline text block text -Approve 2nd release +Approve second release user clicks link Sign off user approves original release for immediate publication -Navigate to publication to verify the legacy releases +Validate second release has latest release status in publication release order user navigates to publication page from dashboard ${PUBLICATION_NAME} user clicks link Legacy releases user waits until h2 is visible Legacy releases -Return to Admin and create first amendment + user checks table body has x rows 4 testid:release-series + + user checks table cell contains 1 1 ${RELEASE_2_NAME} + user checks table cell contains 1 2 ${PUBLIC_RELEASE_2_URL} + user checks table cell contains 1 3 Latest release + + user checks table cell contains 2 1 ${LEGACY_RELEASE_2_DESCRIPTION} + user checks table cell contains 2 2 ${LEGACY_RELEASE_2_URL} + user checks table cell contains 2 3 Legacy release + user checks table cell contains 2 4 Edit + user checks table cell contains 2 4 Delete + + user checks table cell contains 3 1 ${LEGACY_RELEASE_1_DESCRIPTION_UPDATED} + user checks table cell contains 3 2 ${LEGACY_RELEASE_1_URL_UPDATED} + user checks table cell contains 3 3 Legacy release + user checks table cell contains 3 4 Edit + user checks table cell contains 3 4 Delete + + user checks table cell contains 4 1 ${RELEASE_1_NAME} + user checks table cell contains 4 2 ${PUBLIC_RELEASE_1_URL} + user checks table cell does not contain 4 3 Latest release + +Validate other releases section on public frontend includes first release with expected order + user navigates to public frontend ${PUBLIC_RELEASE_2_URL} + user checks number of other releases is correct 3 + ${view_releases}= user opens details dropdown View releases (3) + + user checks other release is shown in position ${LEGACY_RELEASE_2_DESCRIPTION} 1 + user checks other release is shown in position ${LEGACY_RELEASE_1_DESCRIPTION_UPDATED} 2 + user checks other release is shown in position ${RELEASE_1_NAME} 3 + +Create amendment of second release user navigates to admin dashboard Bau1 - user creates amendment for release ${PUBLICATION_NAME} ${RELEASE_NAME} + user creates amendment for release ${PUBLICATION_NAME} ${RELEASE_2_NAME} -Navigate to 'Content' page for amendment +Add release note to amendment of second release user clicks link Content - user waits until h2 is visible ${PUBLICATION_NAME} - user waits until page contains button Add a summary text block + user adds a release note Test release note one -Add release note to first amendment - user clicks button Add note - user enters text into element id:create-release-note-form-reason Test release note one - user clicks button Save note - sleep 2 + ${date}= get london date + user waits until element contains css:#release-notes li:nth-of-type(1) time ${date} + user waits until element contains css:#release-notes li:nth-of-type(1) p Test release note one -Navigate to "Sign off" page - user clicks link Sign off - user waits until h3 is visible Release status history - -Approve release amendment +Approve second release amendment user approves amended release for immediate publication - user waits until page contains element testid:public-release-url - ${PUBLIC_AMENDED_RELEASE_LINK}= get value xpath://*[@data-testid="public-release-url"] - check that variable is not empty PUBLIC_RELEASE_LINK ${PUBLIC_AMENDED_RELEASE_LINK} - set suite variable ${PUBLIC_AMENDED_RELEASE_LINK} -Navigate to publication page and verify the amended release +Validate amended second release exists in publication release order user navigates to publication page from dashboard ${PUBLICATION_NAME} user clicks link Legacy releases user waits until h2 is visible Legacy releases -Validate amended legacy releases - user waits until page contains button Reorder releases + user checks table body has x rows 4 testid:release-series - user checks table cell contains 1 1 Academic year Q1 2022/23 - user checks table cell contains 1 2 ${PUBLIC_AMENDED_RELEASE_LINK} + user checks table cell contains 1 1 ${RELEASE_2_NAME} + user checks table cell contains 1 2 ${PUBLIC_RELEASE_2_URL} user checks table cell contains 1 3 Latest release - user checks table cell contains 2 1 ${UPDATED_DESCRIPTION} - user checks table cell contains 2 2 http://test2.com + user checks table cell contains 2 1 ${LEGACY_RELEASE_2_DESCRIPTION} + user checks table cell contains 2 2 ${LEGACY_RELEASE_2_URL} user checks table cell contains 2 3 Legacy release user checks table cell contains 2 4 Edit user checks table cell contains 2 4 Delete - user checks table cell contains 3 1 ${DESCRIPTION} - user checks table cell contains 3 2 http://test.com + user checks table cell contains 3 1 ${LEGACY_RELEASE_1_DESCRIPTION_UPDATED} + user checks table cell contains 3 2 ${LEGACY_RELEASE_1_URL_UPDATED} user checks table cell contains 3 3 Legacy release user checks table cell contains 3 4 Edit user checks table cell contains 3 4 Delete - user checks table cell contains 4 1 Academic year 2020/21 - user checks table cell contains 4 2 ${PUBLIC_RELEASE_LINK} - user checks table cell does not contain 4 3 Latest - -Delete legacy release - user clicks element xpath://tr[3]//*[text()="Delete"] + user checks table cell contains 4 1 ${RELEASE_1_NAME} + user checks table cell contains 4 2 ${PUBLIC_RELEASE_1_URL} + user checks table cell does not contain 4 3 Latest release +Delete first legacy release + user clicks button in table cell 3 4 Delete testid:release-series ${modal}= user waits until modal is visible Delete legacy release user clicks button Confirm ${modal} - user waits until page does not contain element xpath://tr[4] + user waits until modal is not visible Delete legacy release -Validate that deleted legacy release does not exist +Validate first legacy release is deleted from publication release order user waits until page contains button Reorder releases + user checks table body has x rows 3 testid:release-series - user checks table cell contains 1 1 Academic year Q1 2022/23 - user checks table cell contains 1 2 ${PUBLIC_AMENDED_RELEASE_LINK} + user checks table cell contains 1 1 ${RELEASE_2_NAME} + user checks table cell contains 1 2 ${PUBLIC_RELEASE_2_URL} user checks table cell contains 1 3 Latest release - user checks table cell contains 2 1 ${UPDATED_DESCRIPTION} - user checks table cell contains 2 2 http://test2.com + user checks table cell contains 2 1 ${LEGACY_RELEASE_2_DESCRIPTION} + user checks table cell contains 2 2 ${LEGACY_RELEASE_2_URL} user checks table cell contains 2 3 Legacy release user checks table cell contains 2 4 Edit user checks table cell contains 2 4 Delete - user checks table cell contains 3 1 Academic year 2020/21 - user checks table cell contains 3 2 ${PUBLIC_RELEASE_LINK} - user checks table cell does not contain 3 3 Latest + user checks table cell contains 3 1 ${RELEASE_1_NAME} + user checks table cell contains 3 2 ${PUBLIC_RELEASE_1_URL} + user checks table cell does not contain 3 3 Latest release + +Validate other releases section on public frontend does not include first legacy release + user navigates to public frontend ${PUBLIC_RELEASE_2_URL} + user checks number of other releases is correct 2 + ${view_releases}= user opens details dropdown View releases (2) + + user checks other release is shown in position ${LEGACY_RELEASE_2_DESCRIPTION} 1 + user checks other release is shown in position ${RELEASE_1_NAME} 2
---|