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

Fix Cypress Tests #533

Merged
merged 7 commits into from
Jul 23, 2021
Merged

Fix Cypress Tests #533

merged 7 commits into from
Jul 23, 2021

Conversation

daemon1024
Copy link
Member

Fixes #532

@daemon1024
Copy link
Member Author

image
Fixed one of the tests 🥳

@gitpod-io
Copy link

gitpod-io bot commented Jul 21, 2021

@daemon1024
Copy link
Member Author

PurpleAirMarker Tests Fixed 🥳 🥳

Giving some context on what I did,

image

the popup content seemed to be checking for label value which is very specific, instead I checked if it has the data provider url at the end since that will constant in every purple air marker popup :)

@daemon1024 daemon1024 mentioned this pull request Jul 21, 2021
@daemon1024
Copy link
Member Author

Everything passes. pheww. 😸

@daemon1024 daemon1024 requested a review from jywarren July 21, 2021 20:37
@@ -4,17 +4,22 @@ describe('OpenWeatherMap layer', function() {
cy.wait(300)
cy.window().then((win) => {
cy.get('.leaflet-tile-pane').children().should('have.length', 1)
cy.get('#map-city label').click({ force: true })
cy.get('#map-Clouds label').click({ force: true })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - will this be more stable? Like, there are clouds everywhere even though there aren't cities everywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah clouds,temp and pressure seemed to be more general to me among other maps. I just went with clouds.

Copy link
Member

@jywarren jywarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just one change on the "img" selector! Great work!

cy.get('.leaflet-tile-pane').children().should('have.length', 2)
cy.get('.img')
cy.get('img')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, here, it's just going to find ANY image. Let's make it a bit more specific. What is something the clouds layer is DEFINITELY going to display and does it have any characteristic CSS? Does it appear in a named layer?

Copy link
Member Author

@daemon1024 daemon1024 Jul 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tiles seem to contain these images

<img alt="" role="presentation" src="https://c.tile.openweathermap.org/map/clouds/3/5/3.png?appid=4c6704566155a7d0d5d2f107c5156d6e" class="leaflet-tile leaflet-tile-loaded" style="width: 256px; height: 256px; transform: translate3d(1239px, 458px, 0px); opacity: 1;">

So check if the image src contains the term clouds?

Nope no named layer. The check cy.get('.leaflet-tile-pane').children().should('have.length', 2) that the tile layer is increasing is already being checked. What we can check if the newly added div has the image childs or not?

@@ -32,7 +32,7 @@ describe('Purple layer - markers', function() {
const spy = cy.spy(window.top.aut.PurpleAirMarkerLayer, 'requestData')
cy.get('[title="Show minimal markers"]').click().then(() => {
expect(spy).to.be.called
cy.get('.leaflet-overlay-pane svg g').children().should('have.length', 2)
cy.get('.leaflet-overlay-pane svg g').children().should('have.length.gt', 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@@ -43,7 +43,7 @@ describe('Purple layer - markers', function() {
it('shows popup', function() {
cy.get('.leaflet-overlay-pane svg g').children().last().click({ force: true })
cy.get('.leaflet-popup-pane').children().should('have.length', 1)
cy.get('.leaflet-popup-content').should('contain', 'MandMnorth40')
cy.get('.leaflet-popup-content').should('contain', 'www.purpleair.com')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent.

@jywarren
Copy link
Member

jywarren commented Jul 22, 2021 via email

@daemon1024 daemon1024 requested a review from jywarren July 22, 2021 18:15
@jywarren
Copy link
Member

Excellent!!! OK, merging!

@jywarren jywarren merged commit b8e0162 into publiclab:main Jul 23, 2021
@welcome
Copy link

welcome bot commented Jul 23, 2021

Congrats on merging your first pull request! 🙌🎉⚡️
Your code will likely be published to https://publiclab.github.io/leaflet-environmental-layers/example/ in the next few days.
Do join our weekly check-in to share your this week goal and the awesome work you did 😃. Please find the link pinned in the issue section 📝
Now that you've completed this, you can help someone else take their first step!
Reach out to someone else working on theirs on Public Lab's code welcome page. Thanks!

Help others take their first step

Now that you've merged your first pull request, you're the perfect person to help someone else out with this challenging first step. 🙌

https://code.publiclab.org

Try looking at this list of `first-timers-only` issues, and see if someone else is waiting for feedback, or even stuck! 😕

People often get stuck at the same steps, so you might be able to help someone get unstuck, or help lead them to some documentation that'd help. Reach out and be encouraging and friendly! 😄 🎉

Read about how to help support another newcomer here, or find other ways to offer mutual support here.

jywarren added a commit that referenced this pull request Aug 31, 2021
* revised fix for owmloading.gif (#508)

* revised fix for owmloading.gif

* fixed!

* bump to 2.4.3

* Bump @fortawesome/fontawesome-free from 5.11.2 to 5.15.2 (#499)

Bumps [@fortawesome/fontawesome-free](https://github.com/FortAwesome/Font-Awesome) from 5.11.2 to 5.15.2.
- [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
- [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/master/CHANGELOG.md)
- [Commits](FortAwesome/Font-Awesome@5.11.2...5.15.2)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Fix Cypress Tests (#533)

* generalise count assertion of circle markers

* update check in popup content for purpleAirMarker

* test for different map in own

* convert img from class selector to element

* extract LEL from win before checking

* test more specifically for cloud tile img

* update image selector

* Script to generate new spreadsheet layers (#531)

* initial script to generate new spreadsheet layers

* introduce base code for spreadsheet based layers

* new js based script for generating layers

* refactor code

* refactor actual script into a new file

seperated the function in the existing file so as to make it compatible with both action and manual script

* promisify the generate layer function

* Add docs

* Bump @babel/core from 7.8.4 to 7.14.6 (#529)

* Bump @babel/core from 7.8.4 to 7.14.6

Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.8.4 to 7.14.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.6/packages/babel-core)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Update @babel/preset-env to 7.8.7

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: daemon1024 <[email protected]>

* [Security] Bump bootstrap from 4.1.1 to 4.3.1

Bumps [bootstrap](https://github.com/twbs/bootstrap) from 4.1.1 to 4.3.1. **This update includes security fixes.**
- [Release notes](https://github.com/twbs/bootstrap/releases)
- [Commits](twbs/bootstrap@v4.1.1...v4.3.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Bump leaflet-providers from 1.1.17 to 1.12.0

Bumps [leaflet-providers](https://github.com/leaflet-extras/leaflet-providers) from 1.1.17 to 1.12.0.
- [Release notes](https://github.com/leaflet-extras/leaflet-providers/releases)
- [Changelog](https://github.com/leaflet-extras/leaflet-providers/blob/master/CHANGELOG.md)
- [Commits](leaflet-extras/leaflet-providers@1.1.17...1.12.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* [Security] Bump grunt from 1.0.4 to 1.3.0

Bumps [grunt](https://github.com/gruntjs/grunt) from 1.0.4 to 1.3.0. **This update includes a security fix.**
- [Release notes](https://github.com/gruntjs/grunt/releases)
- [Changelog](https://github.com/gruntjs/grunt/blob/main/CHANGELOG)
- [Commits](gruntjs/grunt@v1.0.4...v1.3.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Bump grunt-contrib-jshint from 1.1.0 to 3.0.0

Bumps [grunt-contrib-jshint](https://github.com/gruntjs/grunt-contrib-jshint) from 1.1.0 to 3.0.0.
- [Release notes](https://github.com/gruntjs/grunt-contrib-jshint/releases)
- [Changelog](https://github.com/gruntjs/grunt-contrib-jshint/blob/master/CHANGELOG)
- [Commits](https://github.com/gruntjs/grunt-contrib-jshint/commits)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Bump grunt-contrib-uglify from 2.3.0 to 5.0.1

Bumps [grunt-contrib-uglify](https://github.com/gruntjs/grunt-contrib-uglify) from 2.3.0 to 5.0.1.
- [Release notes](https://github.com/gruntjs/grunt-contrib-uglify/releases)
- [Changelog](https://github.com/gruntjs/grunt-contrib-uglify/blob/main/CHANGELOG)
- [Commits](gruntjs/grunt-contrib-uglify@v2.3.0...v5.0.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Upgrade to GitHub-native Dependabot (#520)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Github Action to generate spreadsheet layers (#545)

* initial script to generate new spreadsheet layers

* introduce base code for spreadsheet based layers

* new js based script for generating layers

* refactor code

* initial gh action for generating layer

* refactor actual script into a new file

seperated the function in the existing file so as to make it compatible with both action and manual script

* update action script

* promisify the generate layer function

* wait for files to be generated

* Generate Pull Request after changes

* refinements

* Handle names with spaces and exec grunt build

* Post comment on error

* Fix name handling

* Use GITHUB_TOKEN from repository

* Add form for new spreadsheet layer (#549)

* Add form for new spreadsheet layer

* Add reference to template spreadsheet

* make textarea readonly

* Add copy button to copy the required data

* Update issue template link to publiclab repo

* Bump leaflet-blurred-location from 1.7.0 to 1.7.1 (#539)

Bumps [leaflet-blurred-location](https://github.com/publiclab/leaflet-blurred-location) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/publiclab/leaflet-blurred-location/releases)
- [Commits](https://github.com/publiclab/leaflet-blurred-location/commits)

---
updated-dependencies:
- dependency-name: leaflet-blurred-location
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump leaflet.blurred-location-display from 1.1.0 to 1.3.1 (#552)

Bumps [leaflet.blurred-location-display](https://github.com/publiclab/leaflet-blurred-location-display) from 1.1.0 to 1.3.1.
- [Release notes](https://github.com/publiclab/leaflet-blurred-location-display/releases)
- [Commits](https://github.com/publiclab/leaflet-blurred-location-display/commits)

---
updated-dependencies:
- dependency-name: leaflet.blurred-location-display
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* v2.4.4

* Require LBLD v1.3.1 (#558)

* Require LBLD v1.3.1

Fixes publiclab/plots2#10033

* force LBLD v1.3.1 and bump to v2.4.5

* Update source of truth of layers in AllLayers.js (#554)

* Update source of truth of layers in AllLayers.js

* default new spreadsheet layer to layer0

* fix purpleair

purpleair is actually a superset of purplelayer and purpleairmarker so it can't be part of a layer group

* Bump grunt-browserify from 5.3.0 to 6.0.0 (#542)

Bumps [grunt-browserify](https://github.com/jmreidy/grunt-browserify) from 5.3.0 to 6.0.0.
- [Release notes](https://github.com/jmreidy/grunt-browserify/releases)
- [Changelog](https://github.com/jmreidy/grunt-browserify/blob/master/CHANGELOG.md)
- [Commits](jmreidy/grunt-browserify@v5.3.0...v6.0.0)

---
updated-dependencies:
- dependency-name: grunt-browserify
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @fortawesome/fontawesome-free from 5.15.2 to 5.15.4 (#551)

Bumps [@fortawesome/fontawesome-free](https://github.com/FortAwesome/Font-Awesome) from 5.15.2 to 5.15.4.
- [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
- [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/master/CHANGELOG.md)
- [Commits](FortAwesome/Font-Awesome@5.15.2...5.15.4)

---
updated-dependencies:
- dependency-name: "@fortawesome/fontawesome-free"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @babel/preset-env from 7.14.7 to 7.15.0 (#547)

Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.14.7 to 7.15.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.0/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump http-server from 0.12.3 to 13.0.0 (#561)

Bumps [http-server](https://github.com/http-party/http-server) from 0.12.3 to 13.0.0.
- [Release notes](https://github.com/http-party/http-server/releases)
- [Commits](http-party/http-server@v0.12.3...v13.0.0)

---
updated-dependencies:
- dependency-name: http-server
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump eslint from 6.7.2 to 7.32.0 (#541)

Bumps [eslint](https://github.com/eslint/eslint) from 6.7.2 to 7.32.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v6.7.2...v7.32.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump leaflet.blurred-location-display from 1.3.1 to 1.3.2 (#562)

Bumps [leaflet.blurred-location-display](https://github.com/publiclab/leaflet-blurred-location-display) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/publiclab/leaflet-blurred-location-display/releases)
- [Commits](https://github.com/publiclab/leaflet-blurred-location-display/commits)

---
updated-dependencies:
- dependency-name: leaflet.blurred-location-display
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump matchdep from 1.0.1 to 2.0.0 (#540)

Bumps [matchdep](https://github.com/tkellen/js-matchdep) from 1.0.1 to 2.0.0.
- [Release notes](https://github.com/tkellen/js-matchdep/releases)
- [Commits](tkellen/js-matchdep@v1.0.1...v2.0.0)

---
updated-dependencies:
- dependency-name: matchdep
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* bump v2.4.6

* Bump leaflet-google-places-autocomplete from 0.0.8 to 0.0.9 (#563)

Bumps [leaflet-google-places-autocomplete](https://github.com/Twista/leaflet-google-places-autocomplete) from 0.0.8 to 0.0.9.
- [Release notes](https://github.com/Twista/leaflet-google-places-autocomplete/releases)
- [Commits](Twista/leaflet-google-places-autocomplete@v0.0.8...v0.0.9)

---
updated-dependencies:
- dependency-name: leaflet-google-places-autocomplete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump jasmine from 2.99.0 to 3.8.0 (#557)

Bumps [jasmine](https://github.com/jasmine/jasmine-npm) from 2.99.0 to 3.8.0.
- [Release notes](https://github.com/jasmine/jasmine-npm/releases)
- [Commits](jasmine/jasmine-npm@v2.99.0...v3.8.0)

---
updated-dependencies:
- dependency-name: jasmine
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump leaflet from 1.3.1 to 1.7.1 (#564)

Bumps [leaflet](https://github.com/Leaflet/Leaflet) from 1.3.1 to 1.7.1.
- [Release notes](https://github.com/Leaflet/Leaflet/releases)
- [Changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md)
- [Commits](Leaflet/Leaflet@v1.3.1...v1.7.1)

---
updated-dependencies:
- dependency-name: leaflet
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump resig-class from 1.0.0 to 2.0.0 (#560)

Bumps [resig-class](https://github.com/mattinsler/resig-class) from 1.0.0 to 2.0.0.
- [Release notes](https://github.com/mattinsler/resig-class/releases)
- [Commits](mattinsler/resig-class@v1.0.0...v2.0.0)

---
updated-dependencies:
- dependency-name: resig-class
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump leaflet-spin from 1.1.0 to 1.1.2 (#535)

Bumps [leaflet-spin](https://github.com/makinacorpus/Leaflet.Spin) from 1.1.0 to 1.1.2.
- [Release notes](https://github.com/makinacorpus/Leaflet.Spin/releases)
- [Commits](makinacorpus/Leaflet.Spin@1.1.0...1.1.2)

---
updated-dependencies:
- dependency-name: leaflet-spin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump grunt from 1.3.0 to 1.4.1 (#567)

Bumps [grunt](https://github.com/gruntjs/grunt) from 1.3.0 to 1.4.1.
- [Release notes](https://github.com/gruntjs/grunt/releases)
- [Changelog](https://github.com/gruntjs/grunt/blob/main/CHANGELOG)
- [Commits](gruntjs/grunt@v1.3.0...v1.4.1)

---
updated-dependencies:
- dependency-name: grunt
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @babel/core from 7.14.6 to 7.15.0 (#566)

Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.14.6 to 7.15.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.0/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* require LBLD v1.3.2 and bump LEL to v2.4.7 (#568)

* parse title in JSONParser for LBLD (#569)

* parse title in JSONParser for LBLD

* bump to v2.4.8

* github-pages changes

* this commit should help add required files to make github pages work as intended
* removed nod_modules from gitignore
* add nojekyll file

* add node_modules for github-pages

* fix leaflet spin

Co-authored-by: Jeffrey Warren <[email protected]>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress Tests Failure
2 participants