howitzer 2.0.3 → 2.1.0
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 +4 -4
- data/.rubocop.yml +8 -2
- data/.travis.yml +3 -3
- data/CHANGELOG.md +27 -11
- data/Gemfile +1 -0
- data/ISSUE_TEMPLATE.md +16 -0
- data/README.md +2 -1
- data/Rakefile +18 -2
- data/bin/howitzer +7 -6
- data/features/cli_help.feature +1 -1
- data/features/cli_new.feature +51 -11
- data/features/cli_update.feature +44 -4
- data/features/cli_version.feature +1 -1
- data/features/step_definitions/common_steps.rb +5 -0
- data/generators/base_generator.rb +30 -16
- data/generators/config/config_generator.rb +13 -3
- data/generators/config/templates/boot.rb +1 -1
- data/generators/config/templates/capybara.rb +2 -128
- data/generators/config/templates/default.yml +20 -3
- data/generators/config/templates/drivers/browserstack.rb +19 -0
- data/generators/config/templates/drivers/crossbrowsertesting.rb +25 -0
- data/generators/config/templates/drivers/headless_chrome.rb +16 -0
- data/generators/config/templates/drivers/phantomjs.rb +20 -0
- data/generators/config/templates/drivers/poltergeist.rb +11 -0
- data/generators/config/templates/drivers/sauce.rb +21 -0
- data/generators/config/templates/drivers/selenium.rb +24 -0
- data/generators/config/templates/drivers/selenium_grid.rb +27 -0
- data/generators/config/templates/drivers/testingbot.rb +20 -0
- data/generators/config/templates/drivers/webkit.rb +6 -0
- data/generators/cucumber/cucumber_generator.rb +2 -2
- data/generators/cucumber/templates/cucumber.rake +0 -8
- data/generators/cucumber/templates/env.rb +1 -1
- data/generators/cucumber/templates/transformers.rb +11 -25
- data/generators/emails/emails_generator.rb +2 -2
- data/generators/emails/templates/example_email.rb +1 -1
- data/generators/prerequisites/prerequisites_generator.rb +3 -3
- data/generators/prerequisites/templates/base.rb +1 -1
- data/generators/prerequisites/templates/{factory_girl.rb → factory_bot.rb} +6 -6
- data/generators/prerequisites/templates/users.rb +1 -1
- data/generators/root/root_generator.rb +2 -2
- data/generators/root/templates/.rubocop.yml +2 -2
- data/generators/root/templates/Gemfile.erb +14 -18
- data/generators/rspec/rspec_generator.rb +2 -2
- data/generators/rspec/templates/spec_helper.rb +1 -1
- data/generators/tasks/tasks_generator.rb +2 -2
- data/generators/turnip/templates/spec_helper.rb +1 -1
- data/generators/turnip/turnip_generator.rb +2 -2
- data/generators/web/web_generator.rb +2 -2
- data/howitzer.gemspec +3 -1
- data/lib/howitzer/capybara_helpers.rb +25 -8
- data/lib/howitzer/gmail_api.rb +7 -0
- data/lib/howitzer/gmail_api/client.rb +22 -0
- data/lib/howitzer/mail_adapters/gmail.rb +93 -0
- data/lib/howitzer/mail_adapters/mailgun.rb +2 -2
- data/lib/howitzer/mail_adapters/mailtrap.rb +105 -0
- data/lib/howitzer/mailtrap_api.rb +7 -0
- data/lib/howitzer/mailtrap_api/client.rb +52 -0
- data/lib/howitzer/version.rb +1 -1
- data/lib/howitzer/web/page.rb +13 -1
- data/lib/howitzer/web/page_dsl.rb +1 -1
- data/spec/config/custom.yml +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/unit/generators/base_generator_spec.rb +23 -12
- data/spec/unit/generators/config_generator_spec.rb +27 -6
- data/spec/unit/generators/cucumber_generator_spec.rb +8 -8
- data/spec/unit/generators/emails_generator_spec.rb +2 -2
- data/spec/unit/generators/prerequisites_generator_spec.rb +7 -7
- data/spec/unit/generators/root_generator_spec.rb +25 -22
- data/spec/unit/generators/rspec_generator_spec.rb +4 -4
- data/spec/unit/generators/tasks_generator_spec.rb +2 -2
- data/spec/unit/generators/turnip_generator_spec.rb +7 -7
- data/spec/unit/generators/web_generator_spec.rb +3 -3
- data/spec/unit/lib/capybara_helpers_spec.rb +2 -1
- data/spec/unit/lib/gmail_api/client_spec.rb +26 -0
- data/spec/unit/lib/mail_adapters/gmail_spec.rb +128 -0
- data/spec/unit/lib/mail_adapters/mailgun_spec.rb +13 -18
- data/spec/unit/lib/mail_adapters/mailtrap_spec.rb +130 -0
- data/spec/unit/lib/mailgun_api/client_spec.rb +31 -9
- data/spec/unit/lib/mailtrap_api/client_spec.rb +67 -0
- data/spec/unit/lib/web/page_spec.rb +30 -1
- metadata +63 -8
- data/features/support/transformers.rb +0 -3
- data/spec/support/mailgun_unit_client.rb +0 -68
@@ -5,6 +5,10 @@ require 'howitzer/exceptions'
|
|
5
5
|
require 'howitzer/mailgun_api/connector'
|
6
6
|
|
7
7
|
RSpec.describe 'Mailgun Email Adapter' do
|
8
|
+
before do
|
9
|
+
allow(Howitzer).to receive(:mail_adapter) { 'mailgun' }
|
10
|
+
Howitzer::Email.adapter = 'mailgun'
|
11
|
+
end
|
8
12
|
let(:recipient) { 'first_tester@gmail.com' }
|
9
13
|
let(:message) do
|
10
14
|
{
|
@@ -27,8 +31,14 @@ RSpec.describe 'Mailgun Email Adapter' do
|
|
27
31
|
end
|
28
32
|
|
29
33
|
describe '.find' do
|
30
|
-
let(:mailgun_message) {
|
31
|
-
let(:events) {
|
34
|
+
let(:mailgun_message) { JSON.generate(message) }
|
35
|
+
let(:events) { JSON.generate('items' => [event]) }
|
36
|
+
before do
|
37
|
+
FakeWeb.register_uri(:any, 'https://api:mailgun_account_private_key@api.mailgun.net/v3/'\
|
38
|
+
'mailgun@test.domain/events?event=stored', body: events.to_s)
|
39
|
+
FakeWeb.register_uri(:any, 'https://api:mailgun_account_private_key@si.api.mailgun.net/v3/'\
|
40
|
+
'domains/mg.strongqa.com/messages/1234567890', body: mailgun_message.to_s)
|
41
|
+
end
|
32
42
|
subject { Howitzer::MailAdapters::Mailgun.find(recipient, message_subject, wait: 0.01) }
|
33
43
|
|
34
44
|
context 'when message is found' do
|
@@ -46,15 +56,6 @@ RSpec.describe 'Mailgun Email Adapter' do
|
|
46
56
|
}
|
47
57
|
}
|
48
58
|
end
|
49
|
-
before do
|
50
|
-
allow(Howitzer::MailgunApi::Connector.instance.client).to receive(:get).with(
|
51
|
-
'mailgun@test.domain/events',
|
52
|
-
params: { event: 'stored' }
|
53
|
-
) { events }
|
54
|
-
allow(Howitzer::MailgunApi::Connector.instance.client).to receive(:get_url).with(
|
55
|
-
'https://si.api.mailgun.net/v3/domains/mg.strongqa.com/messages/1234567890'
|
56
|
-
) { mailgun_message }
|
57
|
-
end
|
58
59
|
it do
|
59
60
|
expect(Howitzer::Email.adapter).to receive(:new).with(message).once
|
60
61
|
subject
|
@@ -76,12 +77,6 @@ RSpec.describe 'Mailgun Email Adapter' do
|
|
76
77
|
}
|
77
78
|
}
|
78
79
|
end
|
79
|
-
before do
|
80
|
-
allow(Howitzer::MailgunApi::Connector.instance.client).to receive(:get).with(
|
81
|
-
'mailgun@test.domain/events',
|
82
|
-
params: { event: 'stored' }
|
83
|
-
) { events }
|
84
|
-
end
|
85
80
|
it do
|
86
81
|
expect { subject }.to raise_error(
|
87
82
|
Howitzer::EmailNotFoundError,
|
@@ -156,7 +151,7 @@ RSpec.describe 'Mailgun Email Adapter' do
|
|
156
151
|
|
157
152
|
context 'when no attachments' do
|
158
153
|
it do
|
159
|
-
expect { subject }.to raise_error(Howitzer::NoAttachmentsError, 'No attachments
|
154
|
+
expect { subject }.to raise_error(Howitzer::NoAttachmentsError, 'No attachments were found.')
|
160
155
|
end
|
161
156
|
end
|
162
157
|
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'howitzer/email'
|
3
|
+
require 'howitzer/log'
|
4
|
+
require 'howitzer/exceptions'
|
5
|
+
RSpec.describe 'Mailtrap Email Adapter' do
|
6
|
+
before do
|
7
|
+
allow(Howitzer).to receive(:mail_adapter) { 'mailtrap' }
|
8
|
+
Howitzer::Email.adapter = 'mailtrap'
|
9
|
+
allow(Howitzer).to receive(:mailtrap_inbox_id) { 777_777 }
|
10
|
+
allow(Howitzer).to receive(:mailtrap_api_token) { 'fake_api_token' }
|
11
|
+
base_url = 'https://mailtrap.io/api/v1/inboxes/777777/messages'
|
12
|
+
stub_const('Howitzer::MailtrapApi::Client::BASE_URL', base_url.gsub('/messages', ''))
|
13
|
+
FakeWeb.register_uri(:get, "#{base_url}/475265146/attachments", body: attachment.to_s)
|
14
|
+
FakeWeb.register_uri(:get, "#{base_url}/32/attachments", body: '[]')
|
15
|
+
FakeWeb.register_uri(:get, "#{base_url}?search=#{recipient}", body: "[#{message.to_s.gsub('=>', ':')}]")
|
16
|
+
end
|
17
|
+
let(:recipient) { 'test@mail.com' }
|
18
|
+
let(:mail_subject) { 'Confirmation instructions' }
|
19
|
+
let(:message) do
|
20
|
+
{
|
21
|
+
'id' => 475_265_146,
|
22
|
+
'inbox_id' => 777_777,
|
23
|
+
'subject' => 'Confirmation instructions',
|
24
|
+
'sent_at' => '2017-07-18T08:55:49.389Z',
|
25
|
+
'from_email' => 'noreply@test.com',
|
26
|
+
'from_name' => '',
|
27
|
+
'to_email' => 'test@mail.com',
|
28
|
+
'to_name' => '',
|
29
|
+
'html_body' => '<p> Test Email! </p>',
|
30
|
+
'text_body' => 'Test Email!',
|
31
|
+
'created_at' => '2017-07-18T14:14:31.641Z'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
let(:attachment) do
|
35
|
+
'[{
|
36
|
+
"id": 1737,
|
37
|
+
"message_id": 475265146,
|
38
|
+
"filename": "Photos.png",
|
39
|
+
"attachment_type": "attachment",
|
40
|
+
"content_type": "image/png",
|
41
|
+
"download_path": "/api/v1/inboxes/777777/messages/475265146/attachments/45120545/download"
|
42
|
+
}]'
|
43
|
+
end
|
44
|
+
let(:email_object) { Howitzer::Email.adapter.new(message) }
|
45
|
+
describe '.find' do
|
46
|
+
subject { Howitzer::MailAdapters::Mailtrap.find(recipient, mail_subject, wait: 0.01) }
|
47
|
+
context 'when message is found' do
|
48
|
+
it do
|
49
|
+
expect(Howitzer::Email.adapter).to receive(:new).with(message).once
|
50
|
+
subject
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'when message is not found' do
|
55
|
+
let(:mail_subject) { 'Wrong subject' }
|
56
|
+
it do
|
57
|
+
expect { subject }.to raise_error(
|
58
|
+
Howitzer::EmailNotFoundError,
|
59
|
+
"Message with subject '#{mail_subject}' for recipient '#{recipient}' was not found."
|
60
|
+
)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe '#plain_text_body' do
|
66
|
+
it { expect(email_object.plain_text_body).to eql message['text_body'] }
|
67
|
+
end
|
68
|
+
|
69
|
+
describe '#html_body' do
|
70
|
+
it { expect(email_object.html_body).to eql message['html_body'] }
|
71
|
+
end
|
72
|
+
|
73
|
+
describe '#text' do
|
74
|
+
it { expect(email_object.text).to eql message['text_body'] }
|
75
|
+
end
|
76
|
+
|
77
|
+
describe '#mail_from' do
|
78
|
+
it { expect(email_object.mail_from).to eql message['from_email'] }
|
79
|
+
end
|
80
|
+
|
81
|
+
describe '#recipients' do
|
82
|
+
subject { email_object.recipients }
|
83
|
+
it { is_expected.to be_a_kind_of Array }
|
84
|
+
|
85
|
+
context 'when one recipient' do
|
86
|
+
it { is_expected.to include message['to_email'] }
|
87
|
+
end
|
88
|
+
|
89
|
+
context 'when more than one recipient' do
|
90
|
+
let(:second_recipient) { 'second_tester@gmail.com' }
|
91
|
+
let(:message_with_multiple_recipients) { message.merge('to_email' => "#{recipient}, #{second_recipient}") }
|
92
|
+
let(:email_object) { Howitzer::Email.adapter.new(message_with_multiple_recipients) }
|
93
|
+
it { is_expected.to eql [recipient, second_recipient] }
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
describe '#received_time' do
|
98
|
+
it { expect(email_object.received_time).to eql Time.parse(message['created_at']).to_s }
|
99
|
+
end
|
100
|
+
|
101
|
+
describe '#sender_email' do
|
102
|
+
it { expect(email_object.sender_email).to eql message['from_email'] }
|
103
|
+
end
|
104
|
+
|
105
|
+
describe '#mime_part' do
|
106
|
+
context 'when has attachments' do
|
107
|
+
it { expect(email_object.mime_part).not_to be_empty }
|
108
|
+
end
|
109
|
+
|
110
|
+
context 'when no attachments' do
|
111
|
+
let(:another_message) { message.merge('id' => 32) }
|
112
|
+
let(:email_object) { Howitzer::Email.adapter.new(another_message) }
|
113
|
+
it { expect(email_object.mime_part).to be_empty }
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
describe '#mime_part!' do
|
118
|
+
context 'when has attachments' do
|
119
|
+
it { expect(email_object.mime_part!).not_to be_empty }
|
120
|
+
end
|
121
|
+
|
122
|
+
context 'when no attachments' do
|
123
|
+
let(:another_message) { message.merge('id' => 32) }
|
124
|
+
let(:email_object) { Howitzer::Email.adapter.new(another_message) }
|
125
|
+
it do
|
126
|
+
expect { email_object.mime_part! }.to raise_error(Howitzer::NoAttachmentsError, 'No attachments were found.')
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
@@ -3,6 +3,30 @@ require 'howitzer/mailgun_api/client'
|
|
3
3
|
|
4
4
|
RSpec.describe Howitzer::MailgunApi::Client do
|
5
5
|
let(:mg_obj) { described_class.new(api_key: 'Fake-API-Key') }
|
6
|
+
let(:bounce_msg) do
|
7
|
+
JSON.generate(
|
8
|
+
'total_count' => 1,
|
9
|
+
'items' => {
|
10
|
+
'created_at' => 'Fri, 21 Oct 2011 11:02:55 GMT',
|
11
|
+
'code' => 550,
|
12
|
+
'address' => 'baz@example.com',
|
13
|
+
'error' => 'Message was not accepted -- invalid mailbox. Local mailbox baz@example.com is" +
|
14
|
+
" unavailable: user not found'
|
15
|
+
}
|
16
|
+
)
|
17
|
+
end
|
18
|
+
let(:message) do
|
19
|
+
{
|
20
|
+
'body-plain' => 'test body footer',
|
21
|
+
'stripped-html' => '<p> test body </p> <p> footer </p>',
|
22
|
+
'stripped-text' => 'test body',
|
23
|
+
'From' => 'Strong Tester <tester@gmail.com>',
|
24
|
+
'To' => 'baz@example.com',
|
25
|
+
'Received' => 'by 10.216.46.75 with HTTP; Sat, 5 Apr 2014 05:10:42 -0700 (PDT)',
|
26
|
+
'sender' => 'tester@gmail.com',
|
27
|
+
'attachments' => []
|
28
|
+
}
|
29
|
+
end
|
6
30
|
describe '.new' do
|
7
31
|
subject { mg_obj }
|
8
32
|
it { expect { subject }.not_to raise_error }
|
@@ -13,8 +37,8 @@ RSpec.describe Howitzer::MailgunApi::Client do
|
|
13
37
|
subject { mg_obj.get('test.com/bounces', params: query_string) }
|
14
38
|
context 'when simulation of client' do
|
15
39
|
before do
|
16
|
-
|
17
|
-
|
40
|
+
FakeWeb.register_uri(:get, 'https://api:Fake-API-Key@api.mailgun.net/v3/test.com/'\
|
41
|
+
'bounces?skip=10&limit=5', body: bounce_msg.to_s)
|
18
42
|
end
|
19
43
|
it do
|
20
44
|
expect(subject.body).to include('total_count')
|
@@ -36,15 +60,13 @@ RSpec.describe Howitzer::MailgunApi::Client do
|
|
36
60
|
|
37
61
|
describe '#get_url' do
|
38
62
|
let(:response_raw) { double }
|
63
|
+
before do
|
64
|
+
FakeWeb.register_uri(:any, 'https://api:Fake-API-Key@ci.api.mailgan.com/'\
|
65
|
+
'domains/test_domain/messages/asdfasdf', body: JSON.generate(message))
|
66
|
+
end
|
39
67
|
subject { mg_obj.get_url('https://ci.api.mailgan.com/domains/test_domain/messages/asdfasdf') }
|
40
68
|
context 'when success request' do
|
41
|
-
|
42
|
-
let(:response_real) { double }
|
43
|
-
before do
|
44
|
-
allow(RestClient::Request).to receive(:execute).with(any_args).and_return(response_raw)
|
45
|
-
allow(Howitzer::MailgunApi::Response).to receive(:new).with(response_raw).and_return(response_real)
|
46
|
-
end
|
47
|
-
it { is_expected.to eq(response_real) }
|
69
|
+
it { expect(subject.to_h).to eq(message) }
|
48
70
|
end
|
49
71
|
context 'when error happens' do
|
50
72
|
before do
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'howitzer/mailtrap_api/client'
|
3
|
+
|
4
|
+
RSpec.describe Howitzer::MailtrapApi::Client do
|
5
|
+
let(:mailtrap_obj) { described_class.new }
|
6
|
+
let(:recipient) { 'test@mail.com' }
|
7
|
+
let(:mail_subject) { 'Confirmation instructions' }
|
8
|
+
let(:message) do
|
9
|
+
'[{"id": 475265146,
|
10
|
+
"inbox_id": 777777,
|
11
|
+
"subject": "Confirmation instructions",
|
12
|
+
"sent_at": "2017-07-18T08:55:49.389Z",
|
13
|
+
"from_email": "noreply@test.com",
|
14
|
+
"from_name": "",
|
15
|
+
"to_email": "test@mail.com",
|
16
|
+
"to_name": "",
|
17
|
+
"html_body": "<p> Test Email! </p>"}]'
|
18
|
+
end
|
19
|
+
let(:attachment) do
|
20
|
+
'[{
|
21
|
+
"id": 1737,
|
22
|
+
"message_id": 475265146,
|
23
|
+
"filename": "Photos.png",
|
24
|
+
"attachment_type": "attachment",
|
25
|
+
"content_type": "image/png"
|
26
|
+
}]'
|
27
|
+
end
|
28
|
+
before do
|
29
|
+
allow(Howitzer).to receive(:mailtrap_inbox_id) { 777_777 }
|
30
|
+
allow(Howitzer).to receive(:mailtrap_api_token) { 'fake_api_token' }
|
31
|
+
stub_const('Howitzer::MailtrapApi::Client::BASE_URL', 'https://mailtrap.io/api/v1/inboxes/777777')
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '.new' do
|
35
|
+
subject { mailtrap_obj }
|
36
|
+
it { expect { subject }.not_to raise_error }
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#find_message' do
|
40
|
+
before do
|
41
|
+
FakeWeb.register_uri(:get, "https://mailtrap.io/api/v1/inboxes/#{Howitzer.mailtrap_inbox_id}/"\
|
42
|
+
"messages?search=#{recipient}", body: message.to_s)
|
43
|
+
end
|
44
|
+
subject { described_class.new.find_message(recipient, mail_subject) }
|
45
|
+
it do
|
46
|
+
expect(subject['to_email']).to eql(recipient)
|
47
|
+
expect(subject['subject']).to eql(mail_subject)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#find_attachements' do
|
52
|
+
before do
|
53
|
+
FakeWeb.register_uri(:get, "https://mailtrap.io/api/v1/inboxes/#{Howitzer.mailtrap_inbox_id}/"\
|
54
|
+
"messages?search=#{recipient}", body: message.to_s)
|
55
|
+
FakeWeb.register_uri(:get, "https://mailtrap.io/api/v1/inboxes/#{Howitzer.mailtrap_inbox_id}/"\
|
56
|
+
'messages/475265146/attachments', body: attachment.to_s)
|
57
|
+
end
|
58
|
+
let(:found_message) { described_class.new.find_message(recipient, mail_subject) }
|
59
|
+
subject { described_class.new.find_attachments(found_message) }
|
60
|
+
it do
|
61
|
+
subject.each do |attachment|
|
62
|
+
expect(attachment['message_id']).to eql found_message['id']
|
63
|
+
expect(attachment['filename'].to_s).not_to be_empty
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -9,6 +9,35 @@ RSpec.describe Howitzer::Web::Page do
|
|
9
9
|
let(:retryable) { double }
|
10
10
|
let(:check_correct_page_loaded) { double }
|
11
11
|
let(:other_instance) { described_class.instance }
|
12
|
+
|
13
|
+
context 'when custom user_agent specified' do
|
14
|
+
let(:url_value) { 'http://example.com/users' }
|
15
|
+
let(:driver) { double }
|
16
|
+
subject { described_class.open(validate: false) }
|
17
|
+
before do
|
18
|
+
allow(Howitzer).to receive(:user_agent) { 'user_agent' }
|
19
|
+
allow(described_class).to receive(:retryable)
|
20
|
+
allow(described_class).to receive(:expanded_url)
|
21
|
+
allow(Howitzer::Log).to receive(:info)
|
22
|
+
end
|
23
|
+
context 'with webkit driver' do
|
24
|
+
before { allow(Howitzer).to receive(:driver) { 'webkit' } }
|
25
|
+
it do
|
26
|
+
expect(Capybara).to receive_message_chain(:current_session, :driver) { driver }
|
27
|
+
expect(driver).to receive(:header).with('User-Agent', Howitzer.user_agent)
|
28
|
+
subject
|
29
|
+
end
|
30
|
+
end
|
31
|
+
context 'with poltergeist driver' do
|
32
|
+
before { allow(Howitzer).to receive(:driver) { 'poltergeist' } }
|
33
|
+
it do
|
34
|
+
expect(Capybara).to receive_message_chain(:current_session, :driver) { driver }
|
35
|
+
expect(driver).to receive(:add_headers).with('User-Agent' => Howitzer.user_agent)
|
36
|
+
subject
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
12
41
|
context 'when validate missing' do
|
13
42
|
context 'when params present' do
|
14
43
|
let(:url_value) { 'http://example.com/users/1' }
|
@@ -299,7 +328,7 @@ RSpec.describe Howitzer::Web::Page do
|
|
299
328
|
context 'when maximized_window is true and driver is headless_chrome' do
|
300
329
|
before do
|
301
330
|
allow(Howitzer).to receive(:maximized_window) { true }
|
302
|
-
allow(
|
331
|
+
allow(Capybara).to receive(:current_driver) { 'headless_chrome' }
|
303
332
|
end
|
304
333
|
it do
|
305
334
|
expect_any_instance_of(described_class).not_to receive('current_window.maximize')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: howitzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Parashchenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '3.0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: colorize
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: gli
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,6 +72,20 @@ dependencies:
|
|
58
72
|
- - ">="
|
59
73
|
- !ruby/object:Gem::Version
|
60
74
|
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: gmail
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
61
89
|
- !ruby/object:Gem::Dependency
|
62
90
|
name: launchy
|
63
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,6 +160,9 @@ dependencies:
|
|
132
160
|
name: selenium-webdriver
|
133
161
|
requirement: !ruby/object:Gem::Requirement
|
134
162
|
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 3.4.1
|
135
166
|
- - "<"
|
136
167
|
- !ruby/object:Gem::Version
|
137
168
|
version: '4.0'
|
@@ -139,6 +170,9 @@ dependencies:
|
|
139
170
|
prerelease: false
|
140
171
|
version_requirements: !ruby/object:Gem::Requirement
|
141
172
|
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: 3.4.1
|
142
176
|
- - "<"
|
143
177
|
- !ruby/object:Gem::Version
|
144
178
|
version: '4.0'
|
@@ -231,6 +265,7 @@ files:
|
|
231
265
|
- CHANGELOG.md
|
232
266
|
- CONTRIBUTING.md
|
233
267
|
- Gemfile
|
268
|
+
- ISSUE_TEMPLATE.md
|
234
269
|
- LICENSE
|
235
270
|
- MAINTENANCE.md
|
236
271
|
- README.md
|
@@ -243,13 +278,22 @@ files:
|
|
243
278
|
- features/cli_version.feature
|
244
279
|
- features/step_definitions/common_steps.rb
|
245
280
|
- features/support/env.rb
|
246
|
-
- features/support/transformers.rb
|
247
281
|
- generators/base_generator.rb
|
248
282
|
- generators/config/config_generator.rb
|
249
283
|
- generators/config/templates/boot.rb
|
250
284
|
- generators/config/templates/capybara.rb
|
251
285
|
- generators/config/templates/custom.yml
|
252
286
|
- generators/config/templates/default.yml
|
287
|
+
- generators/config/templates/drivers/browserstack.rb
|
288
|
+
- generators/config/templates/drivers/crossbrowsertesting.rb
|
289
|
+
- generators/config/templates/drivers/headless_chrome.rb
|
290
|
+
- generators/config/templates/drivers/phantomjs.rb
|
291
|
+
- generators/config/templates/drivers/poltergeist.rb
|
292
|
+
- generators/config/templates/drivers/sauce.rb
|
293
|
+
- generators/config/templates/drivers/selenium.rb
|
294
|
+
- generators/config/templates/drivers/selenium_grid.rb
|
295
|
+
- generators/config/templates/drivers/testingbot.rb
|
296
|
+
- generators/config/templates/drivers/webkit.rb
|
253
297
|
- generators/cucumber/cucumber_generator.rb
|
254
298
|
- generators/cucumber/templates/common_steps.rb
|
255
299
|
- generators/cucumber/templates/cucumber.rake
|
@@ -262,7 +306,7 @@ files:
|
|
262
306
|
- generators/emails/templates/example_email.rb
|
263
307
|
- generators/prerequisites/prerequisites_generator.rb
|
264
308
|
- generators/prerequisites/templates/base.rb
|
265
|
-
- generators/prerequisites/templates/
|
309
|
+
- generators/prerequisites/templates/factory_bot.rb
|
266
310
|
- generators/prerequisites/templates/user.rb
|
267
311
|
- generators/prerequisites/templates/users.rb
|
268
312
|
- generators/root/root_generator.rb
|
@@ -292,15 +336,21 @@ files:
|
|
292
336
|
- lib/howitzer/capybara_helpers.rb
|
293
337
|
- lib/howitzer/email.rb
|
294
338
|
- lib/howitzer/exceptions.rb
|
339
|
+
- lib/howitzer/gmail_api.rb
|
340
|
+
- lib/howitzer/gmail_api/client.rb
|
295
341
|
- lib/howitzer/log.rb
|
296
342
|
- lib/howitzer/mail_adapters.rb
|
297
343
|
- lib/howitzer/mail_adapters/abstract.rb
|
298
344
|
- lib/howitzer/mail_adapters/debugmail.rb
|
345
|
+
- lib/howitzer/mail_adapters/gmail.rb
|
299
346
|
- lib/howitzer/mail_adapters/mailgun.rb
|
347
|
+
- lib/howitzer/mail_adapters/mailtrap.rb
|
300
348
|
- lib/howitzer/mailgun_api.rb
|
301
349
|
- lib/howitzer/mailgun_api/client.rb
|
302
350
|
- lib/howitzer/mailgun_api/connector.rb
|
303
351
|
- lib/howitzer/mailgun_api/response.rb
|
352
|
+
- lib/howitzer/mailtrap_api.rb
|
353
|
+
- lib/howitzer/mailtrap_api/client.rb
|
304
354
|
- lib/howitzer/tasks/framework.rake
|
305
355
|
- lib/howitzer/utils.rb
|
306
356
|
- lib/howitzer/utils/string_extensions.rb
|
@@ -321,7 +371,6 @@ files:
|
|
321
371
|
- spec/spec_helper.rb
|
322
372
|
- spec/support/generator_helper.rb
|
323
373
|
- spec/support/logger_helper.rb
|
324
|
-
- spec/support/mailgun_unit_client.rb
|
325
374
|
- spec/support/shared_examples/capybara_context_holder.rb
|
326
375
|
- spec/support/shared_examples/capybara_methods_proxy.rb
|
327
376
|
- spec/support/shared_examples/dynamic_section_methods.rb
|
@@ -339,14 +388,18 @@ files:
|
|
339
388
|
- spec/unit/lib/cache_spec.rb
|
340
389
|
- spec/unit/lib/capybara_helpers_spec.rb
|
341
390
|
- spec/unit/lib/email_spec.rb
|
391
|
+
- spec/unit/lib/gmail_api/client_spec.rb
|
342
392
|
- spec/unit/lib/howitzer_spec.rb
|
343
393
|
- spec/unit/lib/init_spec.rb
|
344
394
|
- spec/unit/lib/log_spec.rb
|
345
395
|
- spec/unit/lib/mail_adapters/abstract_spec.rb
|
396
|
+
- spec/unit/lib/mail_adapters/gmail_spec.rb
|
346
397
|
- spec/unit/lib/mail_adapters/mailgun_spec.rb
|
398
|
+
- spec/unit/lib/mail_adapters/mailtrap_spec.rb
|
347
399
|
- spec/unit/lib/mailgun_api/client_spec.rb
|
348
400
|
- spec/unit/lib/mailgun_api/connector_spec.rb
|
349
401
|
- spec/unit/lib/mailgun_api/response_spec.rb
|
402
|
+
- spec/unit/lib/mailtrap_api/client_spec.rb
|
350
403
|
- spec/unit/lib/utils/string_extensions_spec.rb
|
351
404
|
- spec/unit/lib/web/base_section_spec.rb
|
352
405
|
- spec/unit/lib/web/element_dsl_spec.rb
|
@@ -377,7 +430,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
377
430
|
version: '0'
|
378
431
|
requirements: []
|
379
432
|
rubyforge_project:
|
380
|
-
rubygems_version: 2.6.
|
433
|
+
rubygems_version: 2.6.10
|
381
434
|
signing_key:
|
382
435
|
specification_version: 4
|
383
436
|
summary: Ruby based framework for acceptance testing
|
@@ -389,12 +442,10 @@ test_files:
|
|
389
442
|
- features/cli_version.feature
|
390
443
|
- features/step_definitions/common_steps.rb
|
391
444
|
- features/support/env.rb
|
392
|
-
- features/support/transformers.rb
|
393
445
|
- spec/config/custom.yml
|
394
446
|
- spec/spec_helper.rb
|
395
447
|
- spec/support/generator_helper.rb
|
396
448
|
- spec/support/logger_helper.rb
|
397
|
-
- spec/support/mailgun_unit_client.rb
|
398
449
|
- spec/support/shared_examples/capybara_context_holder.rb
|
399
450
|
- spec/support/shared_examples/capybara_methods_proxy.rb
|
400
451
|
- spec/support/shared_examples/dynamic_section_methods.rb
|
@@ -412,14 +463,18 @@ test_files:
|
|
412
463
|
- spec/unit/lib/cache_spec.rb
|
413
464
|
- spec/unit/lib/capybara_helpers_spec.rb
|
414
465
|
- spec/unit/lib/email_spec.rb
|
466
|
+
- spec/unit/lib/gmail_api/client_spec.rb
|
415
467
|
- spec/unit/lib/howitzer_spec.rb
|
416
468
|
- spec/unit/lib/init_spec.rb
|
417
469
|
- spec/unit/lib/log_spec.rb
|
418
470
|
- spec/unit/lib/mail_adapters/abstract_spec.rb
|
471
|
+
- spec/unit/lib/mail_adapters/gmail_spec.rb
|
419
472
|
- spec/unit/lib/mail_adapters/mailgun_spec.rb
|
473
|
+
- spec/unit/lib/mail_adapters/mailtrap_spec.rb
|
420
474
|
- spec/unit/lib/mailgun_api/client_spec.rb
|
421
475
|
- spec/unit/lib/mailgun_api/connector_spec.rb
|
422
476
|
- spec/unit/lib/mailgun_api/response_spec.rb
|
477
|
+
- spec/unit/lib/mailtrap_api/client_spec.rb
|
423
478
|
- spec/unit/lib/utils/string_extensions_spec.rb
|
424
479
|
- spec/unit/lib/web/base_section_spec.rb
|
425
480
|
- spec/unit/lib/web/element_dsl_spec.rb
|