Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge playwright tests to Develop #176

Merged
merged 6 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
- name: "Build Aladin Lite"
run: |
npm run build
- name: "Run some tests"
- name: "Run the rust tests"
run: |
npm run test:build
Xen0Xys marked this conversation as resolved.
Show resolved Hide resolved
npm run test:unit
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]

* [feat] Add support for name removing in `removeOverlay` method
* [test] Add support of playwright. Instructions in the readme for running the test matching snapshots [PR #176]

## 3.4.5-beta

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,15 @@ and run the tests:
cd src/core
cargo test --features webgl2
```

For running the playwright test locally please first install playwright like so:

```bash
npx playwright install
```

After that you will be able to run them. These are generated snapshots that will be compared to ground truth snapshots:

```bash
npm run test:playwright
```
2 changes: 1 addition & 1 deletion examples/al-cat-proper-motion.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

let pmraMean = null, pmdecMean = null;

const pmCat = A.catalogFromURL('./data/proper_motion.xml', {
const pmCat = A.catalogFromURL('./data/votable/proper_motion.xml', {
onClick: 'showTable',
name: 'mean pm over HPX cells around LMC from GaiaDR2',
hoverColor: 'yellow',
Expand Down
8 changes: 4 additions & 4 deletions examples/al-cfht.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import A from '../src/js/A.js';
let aladin;
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div', {survey: "P/PanSTARRS/DR1/color-z-zg-g", fov:1.5, target: "NGC 7318B"});
aladin = A.aladin('#aladin-lite-div', {survey: "data/hips/PanSTARRS_DR1_color-z-zg-g", fov:1.5, target: "NGC 7318B", showSettingsControl: true});
aladin.setProjection('AIT');
let cfht = aladin.createImageSurvey("CFHT", "CFHT MegaCam u+g+r", "https://cds.unistra.fr/~derriere/PR_HiPS/2022_Duc/", "equatorial", 10, {imgFormat: 'png'});
let jwst1 = aladin.createImageSurvey("CDS/P/JWST/Stephans-Quintet/NIRCam+MIRI", "JWST NIRCam+MIRI", "http://alasky.cds.unistra.fr/JWST/CDS_P_JWST_Stephans-Quintet_NIRCam+MIRI", null, null, {imgFormat: 'png'});
let jwst2 = aladin.createImageSurvey("JWST2", "JWST MIRI", "http://alasky.cds.unistra.fr/JWST/CDS_P_JWST_Stephans-Quintet_MIRI", "equatorial", 12, {imgFormat: 'png'});
let cfht = aladin.createImageSurvey("CFHT", "CFHT MegaCam u+g+r", "./data/hips/CFHT", "equatorial", 10, {imgFormat: 'png'});
let jwst1 = aladin.createImageSurvey("CDS/P/JWST/Stephans-Quintet/NIRCam+MIRI", "JWST NIRCam+MIRI", "data/hips/JWST_NIRCam_MIRI", null, null, {imgFormat: 'png'});
let jwst2 = aladin.createImageSurvey("JWST2", "JWST MIRI", "data/hips/JWST_MIRI", "equatorial", 12, {imgFormat: 'png'});
aladin.setOverlayImageLayer('CFHT', 'overlay_CFHT');
aladin.setOverlayImageLayer('CDS/P/JWST/Stephans-Quintet/NIRCam+MIRI', 'overlay_JWST1');
aladin.setOverlayImageLayer('JWST2', 'overlay_JWST2');
Expand Down
5 changes: 1 addition & 4 deletions examples/al-displayFITS.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@

aladin.displayFITS(
//'https://fits.gsfc.nasa.gov/samples/FOCx38i0101t_c0f.fits', // url of the fits file
'images/panstarrs-g-m61.fits',
//'data/fits/neowise.fits',
//'data/fits/irac.fits',
//'data/fits/FOCx38i0101t_c0f.fits',
'data/fits/panstarrs-g-m61.fits',
{
name: 'm61',
colormap: 'viridis'
Expand Down
3 changes: 1 addition & 2 deletions examples/al-hips-local.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<body>

<div id="aladin-lite-div" style="width: 1024px; height: 768px"></div>
<!--<script type="text/javascript" src="./../dist/aladin.umd.cjs" charset="utf-8"></script>-->

<script type="module">
import A from '../src/js/A.js';
Expand All @@ -14,7 +13,7 @@
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div', {target: "05 40 59.12 -02 27 04.1", fov: 2});

let survey = aladin.createImageSurvey('DSS2 local', "local hips", "./hips/CDS_P_DSS2_color");
let survey = aladin.createImageSurvey('DSS2 local', "local hips", "data/hips/CDS_P_DSS2_color");
aladin.setBaseImageLayer(survey);
});
</script>
Expand Down
4 changes: 2 additions & 2 deletions examples/al-onames-labels.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import A from '../src/js/A.js';
let aladin;
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div', {survey: 'P/DSS2/red', target: 'M1', fov: 0.3});
var cat = A.catalogFromURL('http://cdsxmatch.u-strasbg.fr/QueryCat/QueryCat?catName=SIMBAD&mode=cone&pos=M1&r=50arcmin&format=votable&limit=3000', {sourceSize:12, color: '#cc99bb', displayLabel: true, labelColumn: 'main_id', labelColor: '#ae4', labelFont: '9px sans-serif'});
aladin = A.aladin('#aladin-lite-div', {survey: 'data/hips/CDS_P_DSS2_color', target: 'M1', fov: 0.3});
var cat = A.catalogFromURL('data/votable/labels.vot', {sourceSize:12, color: '#cc99bb', displayLabel: true, labelColumn: 'main_id', labelColor: '#ae4', labelFont: '9px sans-serif'});
aladin.addCatalog(cat);
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion examples/al-soda-eso.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div', {fullScreen: true, target: "orion", fov: 10, projection: 'SIN', showContextMenu: true});

const c1 = A.catalogFromURL('./data/eso.xml', {onClick: 'showTable'});
const c1 = A.catalogFromURL('./data/votable/eso.xml', {onClick: 'showTable'});
aladin.addCatalog(c1);
});
</script>
Expand Down
44 changes: 44 additions & 0 deletions examples/al-ui-off.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
</head>
<body>
<div id="aladin-lite-div" style="width: 500px; height: 500px"></div>

<script type="module">
import A from '../src/js/A.js';

var aladin;
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div',
{
fullScreen: true,
cooFrame: "ICRSd",
survey: "../examples/hips/CDS_P_DSS2_color",
target: "05 40 59.12 -02 27 04.1",
fov: 2,
showSimbadPointerControl: false,
showShareControl: false,
showContextMenu: false,
showCatalog: false,
showFov: false,
showCooGrid: false,
showFrame: false,
showCooGridControl: false,
showCooLocation: false,
showFullscreenControl: false,
showLayersControl: false,
showProjectionControl: false,
showReticle: false,
showSettingsControl: false,
showStatusBar: false,
showZoomControl: false,
log: false, // disable the log for the test
}
);
});
</script>

</body>
</html>
44 changes: 44 additions & 0 deletions examples/al-ui-on.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
</head>
<body>
<div id="aladin-lite-div" style="width: 500px; height: 500px"></div>

<script type="module">
import A from '../src/js/A.js';

var aladin;
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div',
{
fullScreen: true,
cooFrame: "ICRSd",
survey: "../examples/hips/CDS_P_DSS2_color",
target: "05 40 59.12 -02 27 04.1",
fov: 2,
showSimbadPointerControl: true,
showShareControl: true,
showContextMenu: true,
showCatalog: true,
showFov: true,
showCooGrid: true,
showFrame: true,
showCooGridControl: true,
showCooLocation: true,
showFullscreenControl: true,
showLayersControl: true,
showProjectionControl: true,
showReticle: true,
showSettingsControl: true,
showStatusBar: true,
showZoomControl: true,
log: false, // disable the log for the test
}
);
});
</script>

</body>
</html>
Binary file added examples/data/gw/gw_0.1.fits
Binary file not shown.
Binary file added examples/data/gw/gw_0.3.fits
Binary file not shown.
Binary file added examples/data/gw/gw_0.6.fits
Binary file not shown.
Binary file added examples/data/gw/gw_0.9.fits
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hips_creation_date = 2010-05-01T19:05Z
hips_release_date = 2019-05-07T10:55Z
hips_creator = Oberto A. (CDS) , Fernique P. (CDS)
hips_version = 1.4
hips_order = 5
hips_order = 7
hips_frame = equatorial
hips_tile_width = 512
hips_tile_format = jpeg
Expand All @@ -27,7 +27,7 @@ hips_pixel_scale = 2.236E-4
hips_initial_ra = 085.30251
hips_initial_dec = -02.25468
hips_initial_fov = 2
moc_sky_fraction = 0.001302
moc_sky_fraction = 2.034E-5
hips_copyright = CNRS/Unistra
obs_ack = The Digitized Sky Surveys were produced at the Space Telescope Science Institute under U.S. Government grant NAG W-2166. The images of these surveys are based on photographic data obtained using the Oschin Schmidt Telescope on Palomar Mountain and the UK Schmidt Telescope. The plates were processed into the present compressed digital form with the permission of these institutions. The National Geographic Society - Palomar Observatory Sky Atlas (POSS-I) was made by the California Institute of Technology with grants from the National Geographic Society. The Second Palomar Observatory Sky Survey (POSS-II) was made by the California Institute of Technology with funds from the National Science Foundation, the National Geographic Society, the Sloan Foundation, the Samuel Oschin Foundation, and the Eastman Kodak Corporation. The Oschin Schmidt Telescope is operated by the California Institute of Technology and Palomar Observatory. The UK Schmidt Telescope was operated by the Royal Observatory Edinburgh, with funding from the UK Science and Engineering Research Council (later the UK Particle Physics and Astronomy Research Council), until 1988 June, and thereafter by the Anglo-Australian Observatory. The blue plates of the southern Sky Atlas and its Equatorial Extension (together known as the SERC-J), as well as the Equatorial Red (ER), and the Second Epoch [red] Survey (SES) were all taken with the UK Schmidt. Supplemental funding for sky-survey work at the ST ScI is provided by the European Southern Observatory.
prov_progenitor = STScI
Expand All @@ -44,5 +44,5 @@ hips_order_min = 0
dataproduct_subtype = color
hipsgen_date = 2019-05-07T10:55Z
hipsgen_params = out=/asd-volumes/sc1-asd-volume8/DSS/DSSColor UPDATE
hipsgen_date_1 = 2024-07-22T14:13Z
hipsgen_params_1 = order=5 region=3/357 in=https://alasky.cds.unistra.fr/DSS/DSSColor/ MIRROR
hipsgen_date_1 = 2024-09-10T14:49Z
hipsgen_params_1 = in=https://alasky.cds.unistra.fr/DSS/DSSColor out=./hips/CDS_P_DSS2_color region=6/24185 order=7 MIRROR
Binary file added examples/data/hips/CFHT/Moc.fits
Binary file not shown.
Binary file added examples/data/hips/CFHT/Norder0/Dir0/Npix3.png
Binary file added examples/data/hips/CFHT/Norder1/Dir0/Npix13.png
Binary file added examples/data/hips/CFHT/Norder2/Dir0/Npix52.png
Binary file added examples/data/hips/CFHT/Norder3/Allsky.png
Binary file added examples/data/hips/CFHT/Norder3/Dir0/Npix211.png
Binary file added examples/data/hips/CFHT/Norder4/Dir0/Npix844.png
Binary file added examples/data/hips/CFHT/Norder4/Dir0/Npix845.png
Binary file added examples/data/hips/CFHT/Norder5/Dir0/Npix3377.png
Binary file added examples/data/hips/CFHT/Norder5/Dir0/Npix3379.png
Binary file added examples/data/hips/CFHT/Norder5/Dir0/Npix3382.png
1,399 changes: 1,399 additions & 0 deletions examples/data/hips/CFHT/index.html

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions examples/data/hips/CFHT/properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
hips_initial_fov = 1.17162
hips_initial_ra = 339.12169
hips_initial_dec = +34.2324
creator_did = ivo://CDS/P/CDS_EPO/2022_Duc
hips_overlay = mean
hips_hierarchy = median
hips_creator = Sebastien Derriere, CDS
#hips_copyright = Copyright mention of the HiPS
obs_title = CFHT deep view of NGC7331 and Stephan's quintet u+g+r
#obs_collection = Dataset collection name
obs_description = CFHT MegaCam u+g+r color composition enhancing low surface brightness stellar components
obs_ack = Image created by P.-A. Duc
prov_progenitor = CFHT MegaCam observations
#bib_reference = Bibcode for bibliographic reference
bib_reference_url = https://www.nature.com/articles/s41586-022-05206-x
#obs_copyright = Copyright mention of the original data
#obs_copyright_url = URL to copyright page of the original data
#t_min = Start time in MJD ( =(Unixtime/86400)+40587 or https://heasarc.gsfc.nasa.gov/cgi-bin/Tools/xTime/xTime.pl)
#t_max = Stop time in MJD
#obs_regime = Waveband keyword (Radio Infrared Optical UV X-ray Gamma-ray)
#em_min = Start in spectral coordinates in meters ( =2.998E8/freq in Hz, or =1.2398841929E-12*energy in MeV )
#em_max = Stop in spectral coordinates in meters
hips_builder = Aladin/HipsGen v12.001
hips_version = 1.4
hips_release_date = 2022-10-19T15:00Z
hips_frame = equatorial
hips_order = 5
hips_order_min = 0
hips_tile_width = 512
hips_status = public partial unclonable
hips_tile_format = png
hips_pixel_scale = 1.118E-4
s_pixel_scale = 1.558E-4
dataproduct_type = image
hipsgen_date = 2022-10-18T15:43Z
hipsgen_params = in=NGC7331_u+g+r-max out=NGC7331_u+g+r-maxHiPS creator_did=ivo://CDS
hips_creation_date = 2022-10-18T15:43Z
dataproduct_subtype = color
hipsgen_date_1 = 2024-09-10T15:15Z
hipsgen_params_1 = in=https://cds.unistra.fr/~derriere/PR_HiPS/2022_Duc/ out=./hips/CFHT "region=5/3380 3382 3379 3377" order=5 MIRROR
moc_sky_fraction = 3.425E-5
Binary file added examples/data/hips/Hipsgen.jar
Binary file not shown.
Binary file added examples/data/hips/JWST_MIRI/Moc.fits
Binary file not shown.
Binary file added examples/data/hips/JWST_MIRI/Norder3/Allsky.png
1,399 changes: 1,399 additions & 0 deletions examples/data/hips/JWST_MIRI/index.html

Large diffs are not rendered by default.

Binary file added examples/data/hips/JWST_MIRI/preview.jpg
44 changes: 44 additions & 0 deletions examples/data/hips/JWST_MIRI/properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
hips_initial_fov = 0.07465
hips_initial_ra = 339.00606
hips_initial_dec = +33.95971
creator_did = ivo://CDS/P/JWST/Stephans-Quintet/MIRI
client_category = Image/Infrared/JWST
hips_overlay = mean
hips_hierarchy = median
hips_creator = Boch T. (CDS)
hips_copyright = CNRS/Unistra
obs_title = Stephans Quintet MIRI
obs_collection = JWST
obs_description = An enormous mosaic of Stephan's Quintet is the largest image to date from NASA's James Webb Space Telescope, covering about one-fifth of the Moon's diameter. It contains over 150 million pixels and is constructed from almost 1,000 separate image files. The visual grouping of five galaxies was captured by Webb's Mid-Infrared Instrument (MIRI). Hipsilized by CDS.
obs_ack = NASA, ESA, CSA, and STScI
obs_ack_url = https://www.nasa.gov/webbfirstimages
prov_progenitor = https://webbtelescope.org/news/first-images
#bib_reference = Bibcode for bibliographic reference
#bib_reference_url = URL to bibliographic reference
obs_copyright = NASA, ESA, CSA, and STScI
obs_copyright_url = https://webbtelescope.org/copyright
t_min = 59700
t_max = 59761
obs_regime = Infrared
# 5 to 28 microns
em_min = 5e-6
em_max = 2.8e-5
hips_builder = Aladin/HipsGen v11.071
hips_version = 1.4
hips_release_date = 2022-07-13T13:02Z
hips_frame = equatorial
hips_order = 7
hips_order_min = 0
hips_tile_width = 512
#hips_service_url = ex: http://yourHipsServer/jwst-stephan-miri.png
hips_status = public partial unclonable
hips_tile_format = png
hips_pixel_scale = 2.795E-5
s_pixel_scale = 3.054E-5
dataproduct_type = image
dataproduct_subtype = color
moc_sky_fraction = 1.788E-7
hipsgen_date = 2022-07-13T13:02Z
hipsgen_params = in=quintet-MIRI/jwst-stephan-miri.png creator_did=CDS/P/JWST/Stephans-Quintet/MIRI
hipsgen_date_1 = 2024-09-10T15:02Z
hipsgen_params_1 = in=http://alasky.cds.unistra.fr/JWST/CDS_P_JWST_Stephans-Quintet_MIRI out=./hips/JWST_MIRI region=3/211 order=7 MIRROR
Binary file added examples/data/hips/JWST_NIRCam_MIRI/Moc.fits
Binary file not shown.
1,399 changes: 1,399 additions & 0 deletions examples/data/hips/JWST_NIRCam_MIRI/index.html

Large diffs are not rendered by default.

Binary file added examples/data/hips/JWST_NIRCam_MIRI/preview.jpg
44 changes: 44 additions & 0 deletions examples/data/hips/JWST_NIRCam_MIRI/properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
hips_initial_fov = 0.10547
hips_initial_ra = 338.99754
hips_initial_dec = +33.96049
creator_did = ivo://CDS/P/JWST/Stephans-Quintet/NIRCam+MIRI
client_category = Image/Infrared/JWST
hips_overlay = mean
hips_hierarchy = median
hips_creator = Boch T. (CDS)
hips_copyright = CNRS/Unistra
obs_title = Stephans-Quintet NIRCam+MIRI
obs_collection = JWST
obs_description = An enormous mosaic of Stephan's Quintet is the largest image to date from NASA's James Webb Space Telescope, covering about one-fifth of the Moon's diameter. It contains over 150 million pixels and is constructed from almost 1,000 separate image files. The visual grouping of five galaxies was captured by Webb's Near-Infrared Camera (NIRCam) and Mid-Infrared Instrument (MIRI). Hipslized by CDS.
obs_ack = NASA, ESA, CSA, and STScI
obs_ack_url = https://www.nasa.gov/webbfirstimages
prov_progenitor = https://webbtelescope.org/news/first-images
#bib_reference = Bibcode for bibliographic reference
#bib_reference_url = URL to bibliographic reference
obs_copyright = NASA, ESA, CSA, and STScI
obs_copyright_url = https://webbtelescope.org/copyright
t_min = 59700
t_max = 59761
obs_regime = Infrared
# 0.6 to 28 microns
em_min = 6e-7
em_max = 2.8e-5
hips_builder = Aladin/HipsGen v11.071
hips_version = 1.4
hips_release_date = 2022-07-13T10:30Z
hips_frame = equatorial
hips_order = 7
hips_order_min = 0
hips_tile_width = 512
#hips_service_url = ex: http://yourHipsServer/stsci_2022-034a_12000.jpg
hips_status = public partial unclonable
hips_tile_format = png
hips_pixel_scale = 6.989E-6
s_pixel_scale = 8.789E-6
dataproduct_type = image
dataproduct_subtype = color
moc_sky_fraction = 2.800E-7
hipsgen_date = 2022-07-13T10:30Z
hipsgen_params = in=stephan/stsci_2022-034a_12000.jpg creator_did=CDS/P/JWST/Stephans-Quintet/NIRCam+MIRI
hipsgen_date_1 = 2024-09-10T15:01Z
hipsgen_params_1 = in=http://alasky.cds.unistra.fr/JWST/CDS_P_JWST_Stephans-Quintet_NIRCam+MIRI out=./hips/JWST_NIRCam_MIRI region=3/211 order=7 MIRROR
Binary file not shown.
Loading
Loading