Skip to content

Commit 3c5f77e

Browse files
committed
test: fixed first player control test
1 parent 547b24a commit 3c5f77e

File tree

4 files changed

+562
-60
lines changed

4 files changed

+562
-60
lines changed

cypress.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"video": false,
3-
"screenshotOnRunFailure": false
2+
"video": false,
3+
"screenshotOnRunFailure": false
44
}

cypress/integration/player_controls.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ context("Player controls", () => {
77
cy.visit("http://localhost:8080/controls");
88
});
99

10-
it.skip("clicks on play button and verifies animation is playing", function (done) {
11-
cy.get("#player-one").find("#lottie-play-button").click();
12-
13-
cy.get("#player-one").find('lottie-player').then(($el) => {
10+
it("clicks on play button and verifies animation is playing", function (done) {
11+
cy.get("#player-one lottie-player").then(($el) => {
1412
const playerOne = $el.get(0);
1513

16-
console.log(playerOne);
17-
expect(playerOne.currentState).to.eq("playing");
18-
done();
14+
playerOne.addEventListener("play", () => {
15+
expect(playerOne.currentState).to.eq("playing");
16+
done();
17+
}, { once: true });
1918
});
19+
20+
cy.get("#player-one").find("#lottie-play-button").click();
2021
});
2122

2223
it("clicks on pause button and verifies animation is paused", function (done) {
@@ -50,7 +51,6 @@ context("Player controls", () => {
5051
cy.get("#player-four lottie-player").then(($el) => {
5152
const playerFour = $el.get(0);
5253

53-
console.log(playerFour);
5454
expect(playerFour.loop).to.eq(true);
5555
done();
5656
});

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
11
{
2-
"private": false,
32
"name": "@lottiefiles/vue-lottie-player",
43
"version": "1.0.5",
54
"description": "Lottie player wrapper for Vue.js by LottieFiles",
65
"scripts": {
7-
"release": "semantic-release",
86
"build": "vue-cli-service build --target lib --name @lottiefiles/vue-lottie-player ./src/index.js && rm ./dist/demo.html",
97
"build-with-coverage": "CODE_COVERAGE=true vue-cli-service build --target lib --name @lottiefiles/vue-lottie-player ./src/index.js && rm ./dist/demo.html",
10-
"start-cypress": "yarn run cypress run && npx nyc report --reporter=text-summary",
8+
"release": "semantic-release",
9+
"run-tests": "yarn run build-with-coverage && yarn run serve-app && BACK_PID=$! && wait $BACK_PID && yarn run start-cypress; kill $(lsof -t -i:8080)",
1110
"serve-app": "cd example && yarn run serve &",
12-
"run-tests": "yarn run build-with-coverage && yarn run serve-app && BACK_PID=$! && wait $BACK_PID && yarn run start-cypress",
13-
"postrun-tests": "kill $(lsof -t -i:8080)"
11+
"start-cypress": "yarn run cypress run"
1412
},
1513
"main": "dist/@lottiefiles/vue-lottie-player.common.js",
1614
"files": [
1715
"dist"
1816
],
19-
"contributors": [
20-
{
21-
"name": "Mazin",
22-
"email": "[email protected]"
23-
},
24-
{
25-
"name": "Hunain",
26-
"email": "[email protected]"
27-
},
28-
{
29-
"name": "Karam",
30-
"email": "[email protected]"
31-
}
32-
],
33-
"license": "MIT",
3417
"dependencies": {
3518
"@lottiefiles/lottie-player": "^1.0.4",
3619
"vue": "^2.6.12"
@@ -47,9 +30,11 @@
4730
"@semantic-release/github": "^7.2.1",
4831
"@semantic-release/npm": "^7.1.1",
4932
"@semantic-release/release-notes-generator": "^9.0.2",
33+
"@vue/babel-preset-app": "^5.0.1",
5034
"@vue/cli-service": "^4.5.13",
5135
"@vue/compiler-sfc": "^3.0.11",
5236
"babel-plugin-istanbul": "^6.1.1",
37+
"cypress": "9.5.1",
5338
"husky": ">=4",
5439
"lint-staged": ">=10",
5540
"rollup": "^2.50.1",
@@ -58,6 +43,20 @@
5843
"vue-clickaway": "^2.2.2",
5944
"vue-template-compiler": "^2.6.12"
6045
},
46+
"contributors": [
47+
{
48+
"name": "Mazin",
49+
"email": "[email protected]"
50+
},
51+
{
52+
"name": "Hunain",
53+
"email": "[email protected]"
54+
},
55+
{
56+
"name": "Karam",
57+
"email": "[email protected]"
58+
}
59+
],
6160
"husky": {
6261
"hooks": {
6362
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
@@ -68,5 +67,6 @@
6867
"vue",
6968
"lottie",
7069
"lottiefiles"
71-
]
70+
],
71+
"license": "MIT"
7272
}

0 commit comments

Comments
 (0)