Re-enable EE trial spec and try to fix message spec (#8263)

* Re-enable trial spec

* Wait until entering subject

* Try to fix EE trial spec
This commit is contained in:
Oliver Günther
2020-04-16 12:02:35 +02:00
committed by GitHub
parent 7cbffc4ec6
commit 6173662f1d
6 changed files with 36 additions and 8 deletions
+1
View File
@@ -227,6 +227,7 @@ group :test do
# Mock selenium requests through proxy (for feature tests)
gem 'puffing-billy', '~> 2.3.1'
gem 'table_print', '~> 1.5.6'
gem 'equivalent-xml', '~> 0.6'
gem 'json_spec', '~> 1.1.4'
+2
View File
@@ -906,6 +906,7 @@ GEM
httpclient (>= 2.4)
sys-filesystem (1.3.3)
ffi
table_print (1.5.6)
temple (0.8.2)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
@@ -1122,6 +1123,7 @@ DEPENDENCIES
stringex (~> 2.8.5)
svg-graph (~> 2.1.0)
sys-filesystem (~> 1.3.3)
table_print (~> 1.5.6)
test-prof (~> 0.11.0)
thin (~> 1.7.2)
timecop (~> 0.9.0)
@@ -29,7 +29,7 @@
import {Component, ElementRef} from "@angular/core";
import {I18nService} from "app/modules/common/i18n/i18n.service";
import {EnterpriseTrialService} from "app/components/enterprise/enterprise-trial.service";
import {HttpClient, HttpErrorResponse} from "@angular/common/http";
import {HttpClient} from "@angular/common/http";
import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";
@@ -30,7 +30,6 @@ require 'spec_helper'
describe 'Enterprise trial management',
type: :feature,
skip: true,
driver: :headless_firefox_billy do
let(:admin) { FactoryBot.create(:admin) }
@@ -176,6 +175,9 @@ describe 'Enterprise trial management',
proxy.stub("https://augur.openproject-edge.com:443/public/v1/trials/#{trial_id}")
.and_return(headers: {'Access-Control-Allow-Origin' => '*'}, code: 422, body: waiting_body.to_json)
proxy.stub("https://augur.openproject-edge.com:443/public/v1/trials/#{trial_id}/resend", method: 'post')
.and_return(headers: {'Access-Control-Allow-Origin' => '*'}, code: 200, body: waiting_body.to_json)
find('.button', text: 'Start free trial').click
fill_out_modal
find('.button:not(:disabled)', text: 'Submit').click
@@ -209,13 +211,8 @@ describe 'Enterprise trial management',
end
it 'can confirm that trial regularly' do
# Stub resend method
proxy.stub("https://augur.openproject-edge.com:443/public/v1/trials/#{trial_id}/resend")
.and_return(headers: {'Access-Control-Allow-Origin' => '*'}, code: 200, body: waiting_body.to_json)
find('.op-modal--modal-body #resend-link', text: 'Resend').click
expect(page).to have_text 'Email has been resent.'
expect(page).to have_selector('.notification-box.-success', text: 'Email has been resent.', wait: 20)
expect(page).to have_text 'foo@foocorp.example'
expect(page).to have_text 'email sent - waiting for confirmation'
+3
View File
@@ -71,6 +71,9 @@ module Pages::Messages
end
end
sleep 1
scroll_to_element find('.ck-content')
fill_in 'reply_subject', with: subject if subject
editor = find('.ck-content')
+25
View File
@@ -37,3 +37,28 @@
#
# See https://github.com/oesmith/puffing-billy for more information
require 'billy/capybara/rspec'
require 'table_print' # Add this dependency to your gemfile
##
# To debug stubbed and proxied connections
# uncomment this line
#
# Billy.configure do |c|
# c.record_requests = true
# end
#
# RSpec.configure do |config|
# config.prepend_after(:example, type: :feature) do
# puts "Requests received via Puffing Billy Proxy:"
#
# puts TablePrint::Printer.table_print(Billy.proxy.requests, [
# :status,
# :handler,
# :method,
# { url: { width: 100 } },
# :headers,
# :body
# ])
# end
# end