Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
CristianDavideConte authored May 19, 2022
2 parents 4e58be2 + 425b0c4 commit a8a1fa5
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 40 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/uss_ubuntu_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: uss-tests-ubuntu

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events for beta and master branches
push:
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
chrome-test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
#workaround for creating the package.json file
- name: Setup npm package
run: npm init -y && npm install
# Runs a single command using the runners shell
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm i -D cypress
browser: chrome

firefox-test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
#workaround for creating the package.json file
- name: Setup npm package
run: npm init -y && npm install
# Runs a single command using the runners shell
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm i -D cypress
browser: firefox

#not available yet
# edge-test:
# # The type of runner that the job will run on
# runs-on: ubuntu-latest
# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - name: Checkout
# uses: actions/checkout@v3
# #workaround for creating the package.json file
# - name: Setup npm package
# run: npm init -y && npm install
# #install edge
# - uses: browser-actions/setup-edge@latest
# - name: Print Edge version
# run: (Get-Item (Get-Command msedge).Source).VersionInfo.ProductVersion
# # Runs a single command using the runners shell
# - name: Cypress run
# uses: cypress-io/github-action@v2
# with:
# build: npm i -D cypress
# browser: edge
70 changes: 70 additions & 0 deletions .github/workflows/uss_windows_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: uss-tests-windows

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events for beta and master branches
push:
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
chrome-test:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
#workaround for creating the package.json file
- name: Setup npm package
run: npm init -y && npm install
# Runs a single command using the runners shell
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm i -D cypress
browser: chrome

firefox-test:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
#workaround for creating the package.json file
- name: Setup npm package
run: npm init -y && npm install
# Runs a single command using the runners shell
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm i -D cypress
browser: firefox

edge-test:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
#workaround for creating the package.json file
- name: Setup npm package
run: npm init -y && npm install
#install edge
- uses: browser-actions/setup-edge@latest
- name: Print Edge version
run: (Get-Item (Get-Command msedge).Source).VersionInfo.ProductVersion
# Runs a single command using the runners shell
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm i -D cypress
browser: edge
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
<a href="./docs/Download.md">
<img src="https://img.shields.io/npm/v/universalsmoothscroll?color=rgb%28255%2C50%2C50%29&label=%20Version&logo=npm"/>
</a>
<img width="20"/> <!-- Just empty space -->
<!-- buggy
<img width="20"/> <!-- Just empty space -- >
<a href="./docs/Download.md">
<img src="https://data.jsdelivr.com/v1/package/npm/universalsmoothscroll/badge"/>
</a>
-->
<img width="20"/> <!-- Just empty space -->
<a href="https://www.paypal.com/donate?hosted_button_id=9ZH3MVR56C7M8">
<img id="donate" src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/PayPal.svg/1920px-PayPal.svg.png" height="20" width="80"/>
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/x-axis-getters-tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cypress.config("defaultCommandTimeout", Cypress.env("preferredTimeout"));
var testSite = Cypress.env("testSite")

function bodyScrollLeftShouldToBe(value) {
Expand Down
42 changes: 21 additions & 21 deletions cypress/integration/x-axis-scroll-tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cypress.config("defaultCommandTimeout", Cypress.env("preferredTimeout"));
var testSite = Cypress.env("testSite")

function bodyScrollLeftShouldToBe(value) {
Expand Down Expand Up @@ -33,7 +34,7 @@ describe("scrollXTo-immediatelyStoppedScrolling-Body", function() {
uss = win.uss;
uss._containersData = new Map();
return new Cypress.Promise(resolve => {
uss.scrollXTo(500, uss.getPageScroller(), () => count++);
uss.scrollXTo(500, uss.getPageScroller(), () => {count += 1;});
uss.stopScrollingX(uss.getPageScroller(), resolve);
});
}).then(() => {
Expand All @@ -54,10 +55,10 @@ describe("scrollXToBy-immediatelyStoppedScrolling-Body", function() {
uss = win.uss;
uss._containersData = new Map();
return new Cypress.Promise(resolve => {
uss.scrollXTo(500, uss.getPageScroller(), () => count++);
uss.scrollXTo(500, uss.getPageScroller(), () => {count += 1;});
uss.stopScrollingX(uss.getPageScroller());
uss.scrollXTo(250, uss.getPageScroller(), () => {
count++;
count += 1;
resolve();
});
});
Expand Down Expand Up @@ -132,6 +133,23 @@ describe("scrollXToBy-StillStart-True-Body", function() {
})
})

describe("scrollXToBy-StillStart-False-Body", function() {
var uss;
it("Horizontally scrolls the body to n1 pixels and then extends that animation by n2 pixels", function(){
cy.visit(testSite)
cy.window()
.then((win) => {
uss = win.uss;
uss._containersData = new Map();
return new Cypress.Promise(resolve => {
uss.scrollXTo(100);
uss.scrollXBy(200, uss.getPageScroller(), resolve, false);
});
}).then(() => {
bodyScrollLeftShouldToBe(300);
})
})
})

describe("scrollXToBy-StillStart-False-ExtendedScrollingWhileAnimating-Body", function() {
var uss;
Expand Down Expand Up @@ -186,24 +204,6 @@ describe("scrollXTo-scrollXTo-ReplaceScrollingWhileAnimating-Body", function() {
})
})

describe("scrollXToBy-StillStart-False-Body", function() {
var uss;
it("Horizontally scrolls the body to n1 pixels and then extends that animation by n2 pixels", function(){
cy.visit(testSite)
cy.window()
.then((win) => {
uss = win.uss;
uss._containersData = new Map();
return new Cypress.Promise(resolve => {
uss.scrollXTo(100);
uss.scrollXBy(200, uss.getPageScroller(), resolve, false);
});
}).then(() => {
bodyScrollLeftShouldToBe(300);
})
})
})

describe("isXScrolling-Body", function() {
var uss;
var wasXScrolling;
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/x-axis-setters-tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cypress.config("defaultCommandTimeout", Cypress.env("preferredTimeout"));
var testSite = Cypress.env("testSite")

function bodyScrollLeftShouldToBe(value) {
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/y-axis-getters-tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cypress.config("defaultCommandTimeout", Cypress.env("preferredTimeout"));
var testSite = Cypress.env("testSite")

function bodyScrollTopShouldToBe(value) {
Expand Down
36 changes: 18 additions & 18 deletions cypress/integration/y-axis-scroll-tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cypress.config("defaultCommandTimeout", Cypress.env("preferredTimeout"));
var testSite = Cypress.env("testSite")

function bodyScrollTopShouldToBe(value) {
Expand Down Expand Up @@ -132,6 +133,23 @@ describe("scrollYToBy-StillStart-True-Body", function() {
})
})

describe("scrollYToBy-StillStart-False-Body", function() {
var uss;
it("Vertically scrolls the body to n1 pixels and then extends that animation by n2 pixels", function(){
cy.visit(testSite)
cy.window()
.then((win) => {
uss = win.uss;
uss._containersData = new Map();
return new Cypress.Promise(resolve => {
uss.scrollYTo(100);
uss.scrollYBy(200, uss.getPageScroller(), resolve, false);
});
}).then(() => {
bodyScrollTopShouldToBe(300);
})
})
})

describe("scrollYToBy-StillStart-False-ExtendedScrollingWhileAnimating-Body", function() {
var uss;
Expand Down Expand Up @@ -186,24 +204,6 @@ describe("scrollYTo-scrollYTo-ReplaceScrollingWhileAnimating-Body", function() {
})
})

describe("scrollYToBy-StillStart-False-Body", function() {
var uss;
it("Vertically scrolls the body to n1 pixels and then extends that animation by n2 pixels", function(){
cy.visit(testSite)
cy.window()
.then((win) => {
uss = win.uss;
uss._containersData = new Map();
return new Cypress.Promise(resolve => {
uss.scrollYTo(100);
uss.scrollYBy(200, uss.getPageScroller(), resolve, false);
});
}).then(() => {
bodyScrollTopShouldToBe(300);
})
})
})

describe("isYScrolling-Body", function() {
var uss;
var wasYScrolling;
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/y-axis-setters-tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cypress.config("defaultCommandTimeout", Cypress.env("preferredTimeout"));
var testSite = Cypress.env("testSite")

function bodyScrollTopShouldToBe(value) {
Expand Down

0 comments on commit a8a1fa5

Please sign in to comment.