File tree Expand file tree Collapse file tree 8 files changed +150
-642
lines changed
Expand file tree Collapse file tree 8 files changed +150
-642
lines changed Original file line number Diff line number Diff line change 1+ // server.js
2+ var FakeServer = require ( 'fake-json-api-server/src/nodeServer' ) ;
3+
4+ var resources = require ( './testapp.json' )
5+
6+ new FakeServer ( {
7+ port : 3000 ,
8+ resources : resources
9+ } ) ;
File renamed without changes.
Original file line number Diff line number Diff line change 2727 <input :id =' "input_" + name' v-model =" widget[name]" />
2828 </div >
2929 <div >
30- <button @click =" patchRecord(widget)" >Submit </button >
30+ <button name = " patch_button " @click =" patchRecord(widget)" >Patch </button >
3131 </div >
3232 </div >
3333 </div >
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Vue.use(Vuex)
88
99const api = axios . create ( {
1010 // connect to local jsonapi-mock server
11- baseURL : 'http://localhost:3004 ' ,
11+ baseURL : 'http://localhost:3000 ' ,
1212 headers : {
1313 'Content-Type' : 'application/vnd.api+json' ,
1414 'Accept' : 'application/vnd.api+json'
Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ module.exports = {
66 }
77 } ,
88 "test_settings" : {
9+ "Firefox" : {
10+ "desiredCapabilities" : {
11+ "browserName" : "firefox" ,
12+ "acceptInsecureCerts" : true ,
13+ }
14+ } ,
915 "FirefoxHeadless" : {
1016 "desiredCapabilities" : {
1117 "browserName" : "firefox" ,
Original file line number Diff line number Diff line change 1818 "eslint" : " ^5.6.1" ,
1919 "eslint-loader" : " ^2.1.1" ,
2020 "eslint-plugin-vue" : " ^4.7.1" ,
21+ "fake-json-api-server" : " ^1.6.0" ,
2122 "geckodriver" : " ^1.14.1" ,
22- "jsonapi-mock" : " ^1.4.41" ,
2323 "karma" : " ^3.0.0" ,
2424 "karma-chai" : " ^0.1.0" ,
2525 "karma-coverage" : " ^1.1.2" ,
6262 "url" : " https://github.com/mrichar1/jsonapi-vuex/issues"
6363 },
6464 "scripts" : {
65- "test" : " npm run unit -- --single-run" ,
65+ "test" : " npm run unit -- --single-run && npm run e2e " ,
6666 "unit" : " karma start" ,
67- "e2e" : " concurrently --success first --kill-others \" npm:jsonapimock \" \" vue-cli-service test:e2e --env FirefoxHeadless\" " ,
68- "testapp" : " concurrently --kill-others \" npm:jsonapimock \" \" vue-cli-service serve\" " ,
69- "jsonapimock " : " cp examples/testapp/testapp. json examples/testapp/tmp.json && jsonapi-mock "
67+ "e2e" : " concurrently --success first --kill-others \" npm:fakeapiserver \" \" vue-cli-service test:e2e --env FirefoxHeadless\" " ,
68+ "testapp" : " concurrently --kill-others \" npm:fakeapiserver \" \" vue-cli-service serve\" " ,
69+ "fakeapiserver " : " node examples/fake- json-api-server.js "
7070 },
7171 "dependencies" : {
7272 "jsonpath" : " ^1.0.0" ,
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ module.exports = {
3939 browser . clearValue ( '#input_color' )
4040 browser . setValue ( '#input_color' , 'red' )
4141
42+ // Move so that element is in view (Firefox doesn't render items off-screen)
43+ browser . getLocationInView ( 'button[name=patch_button]' )
44+ browser . click ( 'button[name=patch_button]' )
45+ // Pause for API response
46+ browser . pause ( 1000 )
47+
4248 // Check changes propagate
4349 be . element ( '#span_name' ) . text . to . equal ( 'cog' )
4450 be . element ( '#span_color' ) . text . to . equal ( 'red' )
You can’t perform that action at this time.
0 commit comments