Skip to content

Commit

Permalink
- Fix show header tests
Browse files Browse the repository at this point in the history
- Fix previous next image controls tests
- Add new test handles missing tests due to data change
  • Loading branch information
mudhoney committed Jan 15, 2025
1 parent f24cfd2 commit 472c16b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 6 deletions.
56 changes: 53 additions & 3 deletions tests/desktop/normal/image_layers/previous_next_image.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
import { expect, test } from "@playwright/test";
import { Helioviewer } from "../../../page_objects/helioviewer";

/*
* Go to the image just before the last available image
* It should have previous image button green and available
* Then go to previous image,
* This time it should have previous image button red and not-available
* Also loaded date should match the last images date
*/
test.only("Going back to layer's last available image should disable previous image button with correct colors and availability.", async ({
page
}, info) => {

let hv = new Helioviewer(page, info);

const firstBeforeLastImage = new Date("2024/12/30 20:00:05Z");
const lastImage = new Date("2021/06/01 00:01:29Z");

// 1. LOAD HV
await hv.Load();
await hv.CloseAllNotifications();
await hv.OpenSidebar();

// 2. SET OBSERVATION DATE TO FIRST IMAGE BEFORE LAST IMAGE
await hv.SetObservationDateTimeFromDate(firstBeforeLastImage);
await hv.WaitForLoadingComplete();
await hv.CloseAllNotifications();

const layer = await hv.getImageLayer(0);

// 3. Assert : Image date should be 2024/12/30 20:00:05Z,
await layer.assertImageDate(firstBeforeLastImage);

// 3. Assert : Previous image button should be be green ( and clickable )
await layer.assertHasPreviousImage();

// 4. Action : Go to previous image
await layer.gotoPreviousImage();
await hv.WaitForLoadingComplete();
await hv.CloseAllNotifications();

// 5. Assert : observation date should be 2021/06/01 00:01:29 ,
const loadedDate = await hv.GetLoadedDate();
await expect(loadedDate.getTime()).toBe(lastImage.getTime());

// 6. Assert : Layer date should change to green
await layer.assertImageDateAvailable();

// 7. Assert : Previous image button should be be red ( and not-clickable )
await layer.assertHasNoPreviousImage();
});

/**
* Going previous available image should bring earliest available image,
* and should correctly load previous available image,
Expand All @@ -11,7 +61,7 @@ test("Go back button should first bring observation date to available image date
}, info) => {
let hv = new Helioviewer(page, info);

const previousImageDate = new Date("2021/06/01 00:01:29Z");
const previousImageDate = new Date("2024/12/31 00:04:53Z");

// 1. LOAD HV
await hv.Load();
Expand All @@ -21,7 +71,7 @@ test("Go back button should first bring observation date to available image date
// Layer to check controls
const layer = await hv.getImageLayer(0);

// 2. Assert : Image date should be 2021/06/01 00:01:29 ,
// 2. Assert : Image date should be 2024/12/31 00:04:53,
await layer.assertImageDate(previousImageDate);

// 3. Assert : Go back should be green ( and clickable )
Expand All @@ -43,7 +93,7 @@ test("Go back button should first bring observation date to available image date
await layer.assertImageDateAvailable();

// 8. Assert : Go back go forward should be all red ( not clickable )
await layer.assertHasNoPreviousImage();
await layer.assertHasPreviousImage();
await layer.assertHasNoNextImage();

// 9. Register: Sunscreenshot from 2021/06/01 00:01:29 ,
Expand Down
6 changes: 3 additions & 3 deletions tests/desktop/normal/image_layers/show_image_header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test("Image headers dialog box should show layer image headers, also it should s
["ACS_MODE", "SCIENCE"],
["ACS_SAFE", "NO"],
["ACS_SUNP", "YES"],
["AECDELAY", "1534"],
["AECDELAY", "1537"],
["AECMODE", "ON"]
]);

Expand All @@ -78,7 +78,7 @@ test("Image headers dialog box should show layer image headers, also it should s
["HV_HVS_DETAILS_FILENAME_VERSION", "5.0"],
[
"HV_COMMENT",
"JP2 file created locally at Lockheed LMSAL using hv_aia_list2jp2_gs2 at Tue Jun 1 14:07:45 2021. Contact Helioviewer LMSAL Franchise ([email protected]) for more details/questions/comments regarding this JP2 file. HVS (Helioviewer setup) file used to create this JP2 file: hvs_version5.pro (version 5.0). FITS to JP2 source code provided by ESA/NASA Helioviewer Project [contact the Helioviewer Project at [email protected]][NASA-GSFC] and is available for download at https://launchpad.net/jp2gen. Please contact the source code providers if you suspect an error in the source code. Full source code for the entire Helioviewer Project can be found at https://launchpad.net/helioviewer."
"JP2 file created locally at Lockheed LMSAL using hv_aia_list2jp2_gs2 at Wed Jan 1 14:36:54 2025. Contact Helioviewer LMSAL Franchise ([email protected]) for more details/questions/comments regarding this JP2 file. HVS (Helioviewer setup) file used to create this JP2 file: hvs_version5.pro (version 5.0). FITS to JP2 source code provided by ESA/NASA Helioviewer Project [contact the Helioviewer Project at [email protected]][NASA-GSFC] and is available for download at https://launchpad.net/jp2gen. Please contact the source code providers if you suspect an error in the source code. Full source code for the entire Helioviewer Project can be found at https://launchpad.net/helioviewer."
]
]);

Expand All @@ -89,7 +89,7 @@ test("Image headers dialog box should show layer image headers, also it should s
await imageHeaderDialog.assertImageHeaders([
[
"HV_COMMENT",
"JP2 file created locally at Lockheed LMSAL using hv_aia_list2jp2_gs2 at Tue Jun 1 14:07:45 2021. Contact Helioviewer LMSAL Franchise ([email protected]) for more details/questions/comments regarding this JP2 file. HVS (Helioviewer setup) file used to create this JP2 file: hvs_version5.pro (version 5.0). FITS to JP2 source code provided by ESA/NASA Helioviewer Project [contact the Helioviewer Project at [email protected]][NASA-GSFC] and is available for download at https://launchpad.net/jp2gen. Please contact the source code providers if you suspect an error in the source code. Full source code for the entire Helioviewer Project can be found at https://launchpad.net/helioviewer."
"JP2 file created locally at Lockheed LMSAL using hv_aia_list2jp2_gs2 at Wed Jan 1 14:36:54 2025. Contact Helioviewer LMSAL Franchise ([email protected]) for more details/questions/comments regarding this JP2 file. HVS (Helioviewer setup) file used to create this JP2 file: hvs_version5.pro (version 5.0). FITS to JP2 source code provided by ESA/NASA Helioviewer Project [contact the Helioviewer Project at [email protected]][NASA-GSFC] and is available for download at https://launchpad.net/jp2gen. Please contact the source code providers if you suspect an error in the source code. Full source code for the entire Helioviewer Project can be found at https://launchpad.net/helioviewer."
],
["HV_HVS_DETAILS_FILENAME", "hvs_version5.pro"],
["HV_HVS_DETAILS_FILENAME_VERSION", "5.0"]
Expand Down

0 comments on commit 472c16b

Please sign in to comment.