cypress-on-rails 1.9.1 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df550a0ca15f4fe35c0bdf3227596ea79e6cbb9c407117592383466c81f45447
4
- data.tar.gz: 6dc7c397f9e13dd6ad7f60e5d0bb929bb1aa0a65dab9ed5992f1d260686316ba
3
+ metadata.gz: 19c6280b01cef6fe5088f9a3d1098acf69a116f6118e219992f961f7af7f1a6d
4
+ data.tar.gz: 8408f84cf6d400a87136243c34c49ed228ccde27f14e824aa88d053bf435ad78
5
5
  SHA512:
6
- metadata.gz: cd12f10387af1cd51f91e65acea0b2705970487e101fe963273a70982c0f789a00896bab78ea461a2fee1dab3e1aa63be8d0e9d45e8ab39b8bee7b0c3821a5cb
7
- data.tar.gz: dbf5569c5d5b71bd737b28f656f2c9993a0235ebc9e87c8f42def465521900c713fa9ffe33035b5603d00796c7c6bae39941e36f261b17266159567addf470ff
6
+ metadata.gz: d72faf8adc3ed46442e0bcd91b5420d3dda942192ba014f4ce435284448e06a44de95f72c5d5a007357902eab0d64a7f4965da839c966243997a56ebcecab3e9
7
+ data.tar.gz: 25e8fad0237b6e3f0a891a4d202273257210e42a0056db6026a70a3cbc0c6851a3763e7c2e70016ab76ec3efc7586d786741e271cd0855d52741e6387d6064ed
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [1.10.0]
2
+ [Compare]: https://github.com/shakacode/cypress-on-rails/compare/v1.9.1...v1.10.0
3
+
4
+ ### Changed
5
+ * improve error message received from failed command
6
+
1
7
  ## [1.9.1]
2
8
  [Compare]: https://github.com/shakacode/cypress-on-rails/compare/v1.9.0...v1.9.1
3
9
 
@@ -56,15 +56,20 @@ module CypressOnRails
56
56
  missing_command = commands.find {|command| !@file.exists?(command.file_path) }
57
57
 
58
58
  if missing_command.nil?
59
- results = commands.map { |command| @command_executor.perform(command.file_path, command.options) }
60
-
61
59
  begin
62
- output = results.to_json
63
- rescue NoMethodError
64
- output = {"message" => "Cannot convert to json"}.to_json
65
- end
60
+ results = commands.map { |command| @command_executor.perform(command.file_path, command.options) }
66
61
 
67
- [201, {'Content-Type' => 'application/json'}, [output]]
62
+ begin
63
+ output = results.to_json
64
+ rescue NoMethodError
65
+ output = {"message" => "Cannot convert to json"}.to_json
66
+ end
67
+
68
+ [201, {'Content-Type' => 'application/json'}, [output]]
69
+ rescue => e
70
+ output = {"message" => e.message, "class" => e.class.to_s}.to_json
71
+ [500, {'Content-Type' => 'application/json'}, [output]]
72
+ end
68
73
  else
69
74
  [404, {}, ["could not find command file: #{missing_command.file_path}"]]
70
75
  end
@@ -1,3 +1,3 @@
1
1
  module CypressOnRails
2
- VERSION = '1.9.1'.freeze
2
+ VERSION = '1.10.1'.freeze
3
3
  end
@@ -6,8 +6,12 @@ Cypress.Commands.add('appCommands', function (body) {
6
6
  url: "/__cypress__/command",
7
7
  body: JSON.stringify(body),
8
8
  log: true,
9
- failOnStatusCode: true
9
+ failOnStatusCode: false
10
10
  }).then((response) => {
11
+ if (response.status != 201) {
12
+ expect(response.body.message).to.be.empty
13
+ expect(response.body.status).to.be.equal(201)
14
+ }
11
15
  return response.body
12
16
  });
13
17
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cypress-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - miceportal team
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-03-11 00:00:00.000000000 Z
12
+ date: 2021-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack