-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/download file name from screenshot (#585)
* use forked version of react-modal-image * implement regression tests * remove test.only --------- Co-authored-by: Daniel Garcia Briseno <[email protected]>
- Loading branch information
1 parent
1e56475
commit 8df41ae
Showing
4 changed files
with
60 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...s/desktop/normal/regression/download_from_screenshot_should_have_correct_filename.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { Helioviewer } from '../../../page_objects/helioviewer'; | ||
import * as fs from 'fs'; | ||
|
||
/** | ||
* This test will make Helioviewer load the default AIA 304 image, | ||
* will make a screenshot out of it, and view the screenshot and check the filename we download | ||
* and it should have the correct filename | ||
*/ | ||
test('Download from screenshot fullscreen view, should correctly set filename', async ({ page, browserName }) => { | ||
|
||
test.fixme(browserName === 'webkit', "We couldn't be able to trigger download event for webkit, skipping this test now"); | ||
|
||
let hv = new Helioviewer(page); | ||
|
||
// load helioviewer | ||
// Action 1 : BROWSE TO HELIOVIEWER | ||
await hv.Load(); | ||
await hv.CloseAllNotifications(); | ||
|
||
// Action 2: OPEN SCREENSHOT DRAWER | ||
await hv.screenshot.toggleScreenshotDrawer(); | ||
|
||
// ACTION 3: MAKE A SCREENSHOT AND WAIT FOR THE SUCCESS MESSAGE | ||
await hv.screenshot.createFullScreenshot(); | ||
await hv.screenshot.waitForScreenshotCompleteNotifitication(); | ||
|
||
// assert there should be one screenshot in drawer | ||
await hv.screenshot.assertScreenshotCountFromDrawer(1); | ||
|
||
// ACTION 4: OPEN THE SCREENSHOT TO VIEW IT | ||
await hv.screenshot.viewScreenshotFromScreenshotHistory(1); | ||
await hv.WaitForImageLoad(); | ||
|
||
// now download screenshot from screenshot view via download button | ||
const screenshotFileFromScreenshotView = await hv.screenshot.downloadScreenshotFromViewScreenshotFeature(); | ||
|
||
// ACTION 5: CLICK TO DOWNLOAD THE SCREENSHOT | ||
const download = await hv.screenshot.fetchScreenshotFromViewScreenshotFeature(); | ||
|
||
// Expect the filename matches with our screenshot filenames | ||
await expect(download.suggestedFilename()).toMatch(/\d{4}_\d{2}_\d{2}_\d{2}_\d{2}_\d{2}_AIA_304\.png/); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters