Skip to content

Commit 8ddf076

Browse files
authored
Merge pull request #1 from FMaulwurf/Add-Integration-tests-using-Cypress---PullRequest-#123-from-leosuncin
Add integration tests using cypress pull request gothinkster#123 from leosuncin
2 parents 3630fd2 + 6b37e6c commit 8ddf076

17 files changed

+1051
-13
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ node_modules
66
# testing
77
coverage
88

9+
# Cypress
10+
cypress/screenshots
11+
cypress/videos
12+
913
# production
1014
build
1115

.travis.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
11
language: node_js
2+
23
node_js:
3-
- "10"
4-
env:
5-
matrix:
6-
- REACT=16.3
7-
sudo: false
8-
script:
9-
- npm test
10-
after_success:
11-
- npm run coverage
4+
# Node 10.3+ includes npm@6 which has good "npm ci" command
5+
- 10.8
6+
7+
cache:
8+
# cache both npm modules and Cypress binary
9+
directories:
10+
- ~/.npm
11+
- ~/.cache
12+
override:
13+
- npm ci
14+
- npm run cy:verify
15+
16+
defaults: &defaults
17+
script:
18+
# ## print all Travis environment variables for debugging
19+
- $(npm bin)/print-env TRAVIS
20+
- npm start -- --silent &
21+
- npm run cy:run -- --record --key d6b59750-9fbd-432b-8db5-0f6ee46956b0
22+
# after all tests finish running we need
23+
# to kill all background jobs (like "npm start &")
24+
- kill $(jobs -p) || true
25+
26+
jobs:
27+
include:
28+
# we have multiple jobs to execute using just a single stage
29+
# but we can pass group name via environment variable to Cypress test runner
30+
- stage: test
31+
env:
32+
- STAGE_NAME=1x-electron
33+
<<: *defaults

cypress.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"baseUrl": "http://localhost:4100",
3+
"projectId": "7erj3a"
4+
}

cypress/fixtures/articles.json

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
{
2+
"articles": [
3+
{
4+
"slug": "how-to-train-your-dragon",
5+
"title": "How to train your dragon",
6+
"description": "Ever wonder how?",
7+
"body": "It takes a Jacobian",
8+
"tagList": ["dragons", "training"],
9+
"createdAt": "2016-02-18T03:22:56.637Z",
10+
"updatedAt": "2016-02-18T03:48:35.824Z",
11+
"favorited": false,
12+
"favoritesCount": 0,
13+
"author": {
14+
"username": "jake",
15+
"bio": "I work at statefarm",
16+
"image": "https://i.stack.imgur.com/xHWG8.jpg",
17+
"following": false
18+
}
19+
},
20+
{
21+
"slug": "eternal-return-law-ubermensch",
22+
"title": "Eternal-return law ubermensch",
23+
"description": "Eternal-return law ubermensch decrepit holiest philosophy right merciful victorious philosophy ascetic mountains",
24+
"body": "Eternal-return law ubermensch decrepit holiest philosophy right merciful victorious philosophy ascetic mountains. Gains holiest truth zarathustra victorious evil mountains. Value abstract holiest battle ultimate christianity sexuality justice faith faith christian insofar war. Ocean play suicide holiest burying truth love derive will philosophy love salvation contradict. Hope ascetic decrepit eternal-return ultimate pinnacle ultimate deceptions.",
25+
"tagList": ["philosophy", "ubermensch"],
26+
"createdAt": "2016-02-18T03:22:56.637Z",
27+
"updatedAt": "2016-02-18T03:48:35.824Z",
28+
"favorited": true,
29+
"favoritesCount": 0,
30+
"author": {
31+
"username": "nietzsche",
32+
"bio": "Contradict strong faith victorious merciful",
33+
"image": "http://nietzsche-ipsum.com/nietzsche.jpg",
34+
"following": false
35+
}
36+
},
37+
{
38+
"slug": "how-to-train-your-dragon-2",
39+
"title": "How to train your dragon 2",
40+
"description": "So toothless",
41+
"body": "It a dragon",
42+
"tagList": ["dragons", "training"],
43+
"createdAt": "2016-02-18T03:22:56.637Z",
44+
"updatedAt": "2016-02-18T03:48:35.824Z",
45+
"favorited": false,
46+
"favoritesCount": 0,
47+
"author": {
48+
"username": "jake",
49+
"bio": "I work at statefarm",
50+
"image": "https://i.stack.imgur.com/xHWG8.jpg",
51+
"following": false
52+
}
53+
},
54+
{
55+
"slug": "transvaluation-reason-revaluation-zarathustra",
56+
"title": "Transvaluation reason revaluation zarathustra",
57+
"description": "Transvaluation reason revaluation zarathustra contradict endless passion evil chaos ocean superiority decieve sea",
58+
"body": "Transvaluation reason revaluation zarathustra contradict endless passion evil chaos ocean superiority decieve sea. Oneself of law god hatred oneself transvaluation marvelous self sexuality. Snare law enlightenment joy madness sea horror war ultimate war noble zarathustra victorious pinnacle. Salvation grandeur morality self sexuality ultimate overcome depths ocean insofar. Horror dead derive pious christian inexpedient reason decrepit ultimate will. Love hatred play oneself burying dead faith war superiority deceptions contradict. Ultimate value ubermensch reason insofar.",
59+
"tagList": ["morality", "zarathustra", "philosophy"],
60+
"createdAt": "2016-02-18T03:22:56.637Z",
61+
"updatedAt": "2016-02-18T03:48:35.824Z",
62+
"favorited": false,
63+
"favoritesCount": 0,
64+
"author": {
65+
"username": "nietzsche",
66+
"bio": "Contradict strong faith victorious merciful",
67+
"image": "http://nietzsche-ipsum.com/nietzsche.jpg",
68+
"following": false
69+
}
70+
},
71+
{
72+
"slug": "webtwo-ipsum-unigo-udemy",
73+
"title": "Webtwo ipsum unigo udemy",
74+
"description": "Webtwo ipsum unigo udemy meevee udemy yammer convore voki, balihoo ebay zlio jumo",
75+
"body": "Webtwo ipsum unigo udemy meevee udemy yammer convore voki, balihoo ebay zlio jumo. Dopplr kno jaiku, boxbe. Akismet zillow yuntaa zoodles meebo shopify, napster udemy eskobo ifttt. Wakoopa zoosk prezi blippy, ebay wesabe. Edmodo yammer orkut vimeo zoho, blippy yoono sclipo. Ning nuvvo loopt airbnb, knewton wikia akismet movity, jaiku mog. Spotify jajah jaiku zinch tumblr ngmoco meebo, mzinga oovoo jajah tumblr. Dropio heroku zimbra trulia wufoo joukuu trulia etsy doostang, zillow octopart imvu revver divvyshot babblely flickr.",
76+
"tagList": [],
77+
"createdAt": "2016-02-18T03:22:56.637Z",
78+
"updatedAt": "2016-02-18T03:48:35.824Z",
79+
"favorited": false,
80+
"favoritesCount": 0,
81+
"author": {
82+
"username": "jesus.mcdonalid47",
83+
"bio": "Web 2.0 startup names, just for the heck of it",
84+
"image": "https://randomuser.me/api/portraits/men/92.jpg",
85+
"following": false
86+
}
87+
},
88+
{
89+
"slug": "hipmunk-zillow-kazaa-gsnap-twitter-squidoo-cuil",
90+
"title": "Hipmunk zillow kazaa gsnap twitter squidoo cuil",
91+
"description": "Hipmunk zillow kazaa gsnap twitter squidoo cuil, scribd greplin babblely stypi hulu",
92+
"body": "Hipmunk zillow kazaa gsnap twitter squidoo cuil, scribd greplin babblely stypi hulu. Prezi oovoo lanyrd yoono qeyno zillow, meevee foodzie doostang. Handango skype wakoopa yammer rovio waze, bitly spock wesabe kiko. Zooomr zoho empressr jibjab sclipo meebo nuvvo, ngmoco elgg weebly squidoo knewton. Chumby jabber bubbli twitter yuntaa doostang dopplr, oooj qeyno disqus udemy blyve. mzinga trulia insala. Blekko wufoo omgpop meebo jiglu, tumblr babblely voki. prezi bebo. Kaboodle imvu lala omgpop skype, shopify chumby. Edmodo oooj sifteo joost zoosk edmodo, flickr bebo voxy. Joyent oooj flickr chartly edmodo ngmoco, loopt wesabe nuvvo kazaa. Cuil jaiku tivo wakoopa heekya napster ifttt, twitter tivo kiko ideeli napster. Stypi sococo mozy, convore.",
93+
"tagList": [],
94+
"createdAt": "2016-02-18T03:22:56.637Z",
95+
"updatedAt": "2016-02-18T03:48:35.824Z",
96+
"favorited": false,
97+
"favoritesCount": 0,
98+
"author": {
99+
"username": "jesus.mcdonalid47",
100+
"bio": "Web 2.0 startup names, just for the heck of it",
101+
"image": "https://randomuser.me/api/portraits/men/92.jpg",
102+
"following": false
103+
}
104+
},
105+
{
106+
"slug": "dead-selfish-moral-reason",
107+
"title": "Dead selfish moral reason",
108+
"description": "Dead selfish moral reason christianity chaos endless strong snare",
109+
"body": "Dead selfish moral reason christianity chaos endless strong snare. Joy grandeur selfish eternal-return christian dead. Virtues free hope passion hatred justice war good battle pinnacle deceptions god spirit pinnacle. Eternal-return sexuality faith selfish law ideal ideal convictions sea. Faith law derive revaluation prejudice fearful good ultimate faithful sexuality law. Suicide love contradict against good zarathustra mountains society salvation prejudice hope ideal reason. Intentions endless holiest law moral contradict self holiest morality pious merciful gains.",
110+
"tagList": ["moral", "selfish", "philosophy"],
111+
"createdAt": "2016-02-18T03:22:56.637Z",
112+
"updatedAt": "2016-02-18T03:48:35.824Z",
113+
"favorited": false,
114+
"favoritesCount": 0,
115+
"author": {
116+
"username": "nietzsche",
117+
"bio": "Contradict strong faith victorious merciful",
118+
"image": "http://nietzsche-ipsum.com/nietzsche.jpg",
119+
"following": false
120+
}
121+
},
122+
{
123+
"slug": "i-just-told-you-you-ve-killed-me",
124+
"title": "I just told you! You've killed me!",
125+
"description": "I never loved you. Is that a cooking show?",
126+
"body": "I love this planet! I've got wealth, fame, and access to the depths of sleaze that those things bring. I usually try to keep my sadness pent up inside where it can fester quietly as a mental illness. Oh, how I wish I could believe or understand that! There's only one reasonable course of action now: kill Flexo!\n\nSpare me your space age technobabble, Attila the Hun! My fellow Earthicans, as I have explained in my book 'Earth in the Balance'', and the much more popular ''Harry Potter and the Balance of Earth', we need to defend our planet against pollution. Also dark wizards.",
127+
"tagList": ["planet", "technobabble"],
128+
"createdAt": "2016-02-18T03:22:56.637Z",
129+
"updatedAt": "2016-02-18T03:48:35.824Z",
130+
"favorited": false,
131+
"favoritesCount": 0,
132+
"author": {
133+
"username": "bender",
134+
"bio": "I'm sorry, guys. I never meant to hurt you. Just to destroy everything you ever believed in",
135+
"image": "http://www.unboundworlds.com/wp-content/uploads/2012/03/bender2.jpg",
136+
"following": false
137+
}
138+
},
139+
{
140+
"slug": "what-s-with-you-kids",
141+
"title": "What's with you kids?",
142+
"description": "Every other day it's food, food, food. Alright, I'll get you some stupid food.",
143+
"body": "When I was first asked to make a film about my nephew, Hubert Farnsworth, I thought \"Why should I?\" Then later, Leela made the film. But if I did make it, you can bet there would have been more topless women on motorcycles. Roll film!\n\nIt may comfort you to know that Fry's death took only fifteen seconds, yet the pain was so intense, that it felt to him like fifteen years. And it goes without saying, it caused him to empty his bowels. You're going back for the Countess, aren't you?",
144+
"tagList": ["planet", "motorcycles"],
145+
"createdAt": "2016-02-18T03:22:56.637Z",
146+
"updatedAt": "2016-02-18T03:48:35.824Z",
147+
"favorited": false,
148+
"favoritesCount": 0,
149+
"author": {
150+
"username": "bender",
151+
"bio": "I'm sorry, guys. I never meant to hurt you. Just to destroy everything you ever believed in",
152+
"image": "http://www.unboundworlds.com/wp-content/uploads/2012/03/bender2.jpg",
153+
"following": false
154+
}
155+
},
156+
{
157+
"slug": "well-mercia-s-a-temperate-zone",
158+
"title": "Well, Mercia's a temperate zone!",
159+
"description": "What a strange person. Why do you think that she is a witch? We want a shrubbery!! Burn her anyway!",
160+
"body": "Why do you think that she is a witch? We want a shrubbery!! Burn her! A newt? Why do you think that she is a witch?\n\nI'm not a witch. And the hat. She's a witch! Be quiet! Burn her!\n\nI have to push the pram a lot. The swallow may fly south with the sun, and the house martin or the plover may seek warmer climes in winter, yet these are not strangers to our land. We found them. And this isn't my nose. This is a false one.\n\nWell, what do you want? Bloody Peasant! Look, my liege! Found them? In Mercia?! The coconut's tropical! Burn her anyway! Ah, now we see the violence inherent in the system!\n\nWhat a strange person. I'm not a witch. Why do you think that she is a witch? Knights of Ni, we are but simple travelers who seek the enchanter who lives beyond these woods. We want a shrubbery!!\n\nListen. Strange women lying in ponds distributing swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony. Shut up!",
161+
"tagList": ["mercia", "witch"],
162+
"createdAt": "2016-02-18T03:22:56.637Z",
163+
"updatedAt": "2016-02-18T03:48:35.824Z",
164+
"favorited": false,
165+
"favoritesCount": 0,
166+
"author": {
167+
"username": "monty.python",
168+
"bio": "You can't expect to wield supreme power just 'cause some watery tart threw a sword at you!",
169+
"image": "https://images-na.ssl-images-amazon.com/images/I/710PzQnaomL._SY445_.jpg",
170+
"following": false
171+
}
172+
}
173+
],
174+
"articlesCount": 20
175+
}

cypress/fixtures/authentication.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"jake": {
3+
"email": "[email protected]",
4+
"token": "1200cf8ad3.28a60559cf.5e7c5f46ee",
5+
"username": "jake",
6+
"bio": "I work at statefarm",
7+
"image": "https://i.stack.imgur.com/xHWG8.jpg"
8+
},
9+
"nietzsche": {
10+
"email": "[email protected]",
11+
"token": "40a8a36c43.da3a787b87.0ebcb2d769",
12+
"username": "nietzsche",
13+
"bio": "Contradict strong faith victorious merciful",
14+
"image": "http://nietzsche-ipsum.com/nietzsche.jpg"
15+
},
16+
"jesus.mcdonalid47": {
17+
"email": "[email protected]",
18+
"token": "d3f98b5a2f.7b1324c6e4.7475c89e59",
19+
"username": "jesus.mcdonalid47",
20+
"bio": "Web 2.0 startup names, just for the heck of it",
21+
"image": "https://randomuser.me/api/portraits/men/92.jpg",
22+
"following": false
23+
},
24+
"bender": {
25+
"email": "[email protected]",
26+
"token": "71b475cbc8.23152cb82e.8aef5fc03e",
27+
"username": "bender",
28+
"bio": "I'm sorry, guys. I never meant to hurt you. Just to destroy everything you ever believed in",
29+
"image": "http://www.unboundworlds.com/wp-content/uploads/2012/03/bender2.jpg",
30+
"following": false
31+
},
32+
"monty.python": {
33+
"email": "[email protected]",
34+
"token": "a347aca33d.1084fef2aa.341b81a3a6",
35+
"username": "monty.python",
36+
"bio": "You can't expect to wield supreme power just 'cause some watery tart threw a sword at you!",
37+
"image": "https://images-na.ssl-images-amazon.com/images/I/710PzQnaomL._SY445_.jpg",
38+
"following": false
39+
}
40+
}

cypress/fixtures/comments.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"comments": [
3+
{
4+
"id": 1,
5+
"createdAt": "2016-02-18T03:22:56.637Z",
6+
"updatedAt": "2016-02-18T03:22:56.637Z",
7+
"body": "Wait a minute - you've been declared dead. You can't give orders around here.",
8+
"author": {
9+
"username": "jake",
10+
"bio": "I work at statefarm",
11+
"image": "https://i.stack.imgur.com/xHWG8.jpg",
12+
"following": false
13+
}
14+
},
15+
{
16+
"id": 2,
17+
"createdAt": "2016-02-18T03:22:56.637Z",
18+
"updatedAt": "2016-02-18T03:22:56.637Z",
19+
"body": "Wait a minute - you've been declared dead. You can't give orders around here.",
20+
"author": {
21+
"username": "johnjacob",
22+
"bio": "I work at statefarm",
23+
"image": "https://i.stack.imgur.com/xHWG8.jpg",
24+
"following": false
25+
}
26+
},
27+
{
28+
"id": 3,
29+
"createdAt": "2016-02-18T03:22:56.637Z",
30+
"updatedAt": "2016-02-18T03:22:56.637Z",
31+
"body": "Besides, you look good in a dress.",
32+
"author": {
33+
"username": "jake",
34+
"bio": "I work at statefarm",
35+
"image": "https://i.stack.imgur.com/xHWG8.jpg",
36+
"following": false
37+
}
38+
},
39+
{
40+
"id": 4,
41+
"createdAt": "2016-02-18T03:22:56.637Z",
42+
"updatedAt": "2016-02-18T03:22:56.637Z",
43+
"body": "It's called 'taking advantage.' It's what gets you ahead in life. I care deeply for nature. Whoa, this guy's straight? What's Spanish for \"I know you speak English?\"",
44+
"author": {
45+
"username": "johnjacob",
46+
"bio": "I work at statefarm",
47+
"image": "https://i.stack.imgur.com/xHWG8.jpg",
48+
"following": false
49+
}
50+
},
51+
{
52+
"id": 5,
53+
"createdAt": "2016-02-18T03:22:56.637Z",
54+
"updatedAt": "2016-02-18T03:22:56.637Z",
55+
"body": "There's only one man I've ever called a coward, and that's Brian Doyle Murray. No, what I'm calling you is a television actor.\n\nBad news. Andy Griffith turned us down. He didn't like his trailer. I'm half machine. I'm a monster.",
56+
"author": {
57+
"username": "jake",
58+
"bio": "I work at statefarm",
59+
"image": "https://i.stack.imgur.com/xHWG8.jpg",
60+
"following": false
61+
}
62+
}
63+
]
64+
}

cypress/fixtures/profile.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": 8739,
3+
"name": "Jane",
4+
"email": "[email protected]"
5+
}

cypress/fixtures/profiles.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"jake": {
3+
"username": "jake",
4+
"bio": "I work at statefarm",
5+
"image": "https://i.stack.imgur.com/xHWG8.jpg",
6+
"following": false
7+
},
8+
"nietzsche": {
9+
"username": "nietzsche",
10+
"bio": "Contradict strong faith victorious merciful",
11+
"image": "http://nietzsche-ipsum.com/nietzsche.jpg",
12+
"following": false
13+
},
14+
"jesus.mcdonalid47": {
15+
"username": "jesus.mcdonalid47",
16+
"bio": "Web 2.0 startup names, just for the heck of it",
17+
"image": "https://randomuser.me/api/portraits/men/92.jpg",
18+
"following": false
19+
},
20+
"bender": {
21+
"username": "bender",
22+
"bio": "I'm sorry, guys. I never meant to hurt you. Just to destroy everything you ever believed in",
23+
"image": "http://www.unboundworlds.com/wp-content/uploads/2012/03/bender2.jpg",
24+
"following": false
25+
},
26+
"monty.python": {
27+
"username": "monty.python",
28+
"bio": "You can't expect to wield supreme power just 'cause some watery tart threw a sword at you!",
29+
"image": "https://images-na.ssl-images-amazon.com/images/I/710PzQnaomL._SY445_.jpg",
30+
"following": false
31+
}
32+
}

0 commit comments

Comments
 (0)