Use capybara-selenium with headless chrome
This commit is contained in:
parent
a709bd3fb3
commit
a6cdf714a6
12 changed files with 68 additions and 83 deletions
|
@ -1,68 +1,43 @@
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
working_directory: /tps
|
working_directory: ~/tps
|
||||||
docker:
|
docker:
|
||||||
- image: ruby:2.3.5
|
- image: circleci/ruby:2.3.6-node-browsers
|
||||||
- image: postgres:9.4.1
|
- image: circleci/postgres:9.5
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: tps_test
|
POSTGRES_USER: tps_test
|
||||||
POSTGRES_PASSWORD: tps_test
|
POSTGRES_PASSWORD: tps_test
|
||||||
POSTGRES_DB: tps_test
|
POSTGRES_DB: tps_test
|
||||||
|
|
||||||
install_system_deps: &install_system_deps
|
|
||||||
run:
|
|
||||||
name: Install System Dependencies
|
|
||||||
command: apt-get update -qq && apt-get install -y build-essential nodejs
|
|
||||||
|
|
||||||
restore_phantomjs_cache: &restore_phantomjs_cache
|
|
||||||
restore_cache:
|
|
||||||
key: phantomjs-2-1-1
|
|
||||||
|
|
||||||
bundle_restore_cache: &bundle_restore_cache
|
bundle_restore_cache: &bundle_restore_cache
|
||||||
restore_cache:
|
restore_cache:
|
||||||
key: bundle-install-v4-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
key: bundle-install-v7-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
||||||
|
|
||||||
|
bundle_save_cache: &bundle_save_cache
|
||||||
|
save_cache:
|
||||||
|
key: bundle-install-v7-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
||||||
|
paths:
|
||||||
|
- ~/vendor/bundle
|
||||||
|
|
||||||
bundle_install: &bundle_install
|
bundle_install: &bundle_install
|
||||||
run:
|
run:
|
||||||
name: Install Ruby Dependencies
|
name: Install Ruby Dependencies
|
||||||
command: bundle install
|
command: bundle install --path ~/vendor/bundle
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- *install_system_deps
|
|
||||||
- *bundle_restore_cache
|
- *bundle_restore_cache
|
||||||
- *bundle_install
|
- *bundle_install
|
||||||
- save_cache:
|
- *bundle_save_cache
|
||||||
key: bundle-install-v4-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
|
||||||
paths:
|
|
||||||
- /usr/local/bundle
|
|
||||||
- *restore_phantomjs_cache
|
|
||||||
- run:
|
|
||||||
name: Install PhantomJS Dependencies
|
|
||||||
command: |
|
|
||||||
[ -f /usr/local/bin/phantomjs ] || apt-get update
|
|
||||||
[ -f /usr/local/bin/phantomjs ] || apt-get install -y fontconfig wget
|
|
||||||
- run:
|
|
||||||
name: Install PhantomJS
|
|
||||||
command: |
|
|
||||||
[ -f /usr/local/bin/phantomjs ] || wget -O /tmp/phantomjs.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
|
|
||||||
[ -f /usr/local/bin/phantomjs ] || tar -xjf /tmp/phantomjs.tar.bz2 -C /tmp
|
|
||||||
[ -f /usr/local/bin/phantomjs ] || mv /tmp/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
|
|
||||||
- save_cache:
|
|
||||||
key: phantomjs-2-1-1
|
|
||||||
paths:
|
|
||||||
- /usr/local/bin/phantomjs
|
|
||||||
test:
|
test:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
parallelism: 4
|
parallelism: 4
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- *install_system_deps
|
|
||||||
- *restore_phantomjs_cache
|
|
||||||
- *bundle_restore_cache
|
- *bundle_restore_cache
|
||||||
- *bundle_install
|
- *bundle_install
|
||||||
- run:
|
- run:
|
||||||
|
@ -77,16 +52,15 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
bundle exec rspec --profile 10 \
|
bundle exec rspec --profile 10 \
|
||||||
--format RspecJunitFormatter \
|
--format RspecJunitFormatter \
|
||||||
--out $CIRCLE_TEST_REPORTS/rspec.xml \
|
--out ~/test_results/rspec.xml \
|
||||||
--format progress \
|
--format progress \
|
||||||
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: $CIRCLE_TEST_REPORTS/rspec.xml
|
path: ~/test_results/rspec.xml
|
||||||
lint:
|
lint:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- *install_system_deps
|
|
||||||
- *bundle_restore_cache
|
- *bundle_restore_cache
|
||||||
- *bundle_install
|
- *bundle_install
|
||||||
- run:
|
- run:
|
||||||
|
@ -94,7 +68,7 @@ jobs:
|
||||||
command: bundle exec rubocop -R
|
command: bundle exec rubocop -R
|
||||||
- run:
|
- run:
|
||||||
name: Run brakeman
|
name: Run brakeman
|
||||||
command: bundle exec brakeman -z
|
command: bundle exec brakeman --no-exit-on-warn
|
||||||
- run:
|
- run:
|
||||||
name: Run haml-lint
|
name: Run haml-lint
|
||||||
command: bundle exec haml-lint app/views/
|
command: bundle exec haml-lint app/views/
|
||||||
|
@ -105,7 +79,6 @@ jobs:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- *install_system_deps
|
|
||||||
- *bundle_restore_cache
|
- *bundle_restore_cache
|
||||||
- *bundle_install
|
- *bundle_install
|
||||||
- add_ssh_keys:
|
- add_ssh_keys:
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2.3.5
|
2.3.6
|
||||||
|
|
2
Gemfile
2
Gemfile
|
@ -120,7 +120,7 @@ group :test do
|
||||||
gem 'database_cleaner'
|
gem 'database_cleaner'
|
||||||
gem 'webmock'
|
gem 'webmock'
|
||||||
gem 'shoulda-matchers', require: false
|
gem 'shoulda-matchers', require: false
|
||||||
gem 'poltergeist'
|
gem 'capybara-selenium'
|
||||||
gem 'timecop'
|
gem 'timecop'
|
||||||
gem 'guard'
|
gem 'guard'
|
||||||
gem 'guard-rspec', require: false
|
gem 'guard-rspec', require: false
|
||||||
|
|
17
Gemfile.lock
17
Gemfile.lock
|
@ -105,6 +105,9 @@ GEM
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
xpath (~> 2.0)
|
xpath (~> 2.0)
|
||||||
|
capybara-selenium (0.0.6)
|
||||||
|
capybara
|
||||||
|
selenium-webdriver
|
||||||
carrierwave (0.11.2)
|
carrierwave (0.11.2)
|
||||||
activemodel (>= 3.2.0)
|
activemodel (>= 3.2.0)
|
||||||
activesupport (>= 3.2.0)
|
activesupport (>= 3.2.0)
|
||||||
|
@ -113,9 +116,10 @@ GEM
|
||||||
mimemagic (>= 0.3.0)
|
mimemagic (>= 0.3.0)
|
||||||
carrierwave-i18n (0.2.0)
|
carrierwave-i18n (0.2.0)
|
||||||
chartkick (2.2.1)
|
chartkick (2.2.1)
|
||||||
|
childprocess (0.8.0)
|
||||||
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
chunky_png (1.3.8)
|
chunky_png (1.3.8)
|
||||||
clamav-client (3.1.0)
|
clamav-client (3.1.0)
|
||||||
cliver (0.3.2)
|
|
||||||
coderay (1.1.1)
|
coderay (1.1.1)
|
||||||
coffee-rails (4.2.1)
|
coffee-rails (4.2.1)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
|
@ -466,10 +470,6 @@ GEM
|
||||||
ast (~> 2.2)
|
ast (~> 2.2)
|
||||||
pdf-core (0.6.1)
|
pdf-core (0.6.1)
|
||||||
pg (0.19.0)
|
pg (0.19.0)
|
||||||
poltergeist (1.14.0)
|
|
||||||
capybara (~> 2.1)
|
|
||||||
cliver (~> 0.3.1)
|
|
||||||
websocket-driver (>= 0.2.0)
|
|
||||||
powerpack (0.1.1)
|
powerpack (0.1.1)
|
||||||
prawn (2.0.2)
|
prawn (2.0.2)
|
||||||
pdf-core (~> 0.6.0)
|
pdf-core (~> 0.6.0)
|
||||||
|
@ -613,6 +613,9 @@ GEM
|
||||||
select2-rails (4.0.3)
|
select2-rails (4.0.3)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
selectize-rails (0.12.4.1)
|
selectize-rails (0.12.4.1)
|
||||||
|
selenium-webdriver (3.8.0)
|
||||||
|
childprocess (~> 0.5)
|
||||||
|
rubyzip (~> 1.0)
|
||||||
sentry-raven (2.2.0)
|
sentry-raven (2.2.0)
|
||||||
faraday (>= 0.7.6, < 1.0)
|
faraday (>= 0.7.6, < 1.0)
|
||||||
sexp_processor (4.10.0)
|
sexp_processor (4.10.0)
|
||||||
|
@ -726,6 +729,7 @@ DEPENDENCIES
|
||||||
browser
|
browser
|
||||||
byebug
|
byebug
|
||||||
capybara
|
capybara
|
||||||
|
capybara-selenium
|
||||||
carrierwave
|
carrierwave
|
||||||
carrierwave-i18n
|
carrierwave-i18n
|
||||||
chartkick
|
chartkick
|
||||||
|
@ -765,7 +769,6 @@ DEPENDENCIES
|
||||||
openid_connect
|
openid_connect
|
||||||
openstack
|
openstack
|
||||||
pg
|
pg
|
||||||
poltergeist
|
|
||||||
prawn (~> 2.0.1)
|
prawn (~> 2.0.1)
|
||||||
prawn_rails (~> 0.0.11)
|
prawn_rails (~> 0.0.11)
|
||||||
pry-byebug
|
pry-byebug
|
||||||
|
@ -804,4 +807,4 @@ DEPENDENCIES
|
||||||
xray-rails
|
xray-rails
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.16.0
|
1.16.1
|
||||||
|
|
|
@ -20,7 +20,7 @@ Téléprocédures Simplifiées, ou TPS pour les intimes, est une plateforme 100
|
||||||
|
|
||||||
### Tests
|
### Tests
|
||||||
|
|
||||||
- PhantomJS
|
- Chrome
|
||||||
|
|
||||||
|
|
||||||
## Initialisation de l'environnement de développement
|
## Initialisation de l'environnement de développement
|
||||||
|
|
|
@ -10,17 +10,17 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
||||||
|
|
||||||
context 'Right after sign_in I shall see all procedure states links' do
|
context 'Right after sign_in I shall see all procedure states links' do
|
||||||
scenario 'Finding draft procedures' do
|
scenario 'Finding draft procedures' do
|
||||||
page.find_by_id('draft-procedures').trigger('click')
|
page.find_by_id('draft-procedures').click
|
||||||
expect(page).to have_current_path(admin_procedures_draft_path, only_path: true)
|
expect(page).to have_current_path(admin_procedures_draft_path, only_path: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Finding active procedures' do
|
scenario 'Finding active procedures' do
|
||||||
page.find_by_id('active-procedures').trigger('click')
|
page.find_by_id('active-procedures').click
|
||||||
expect(page).to have_current_path(admin_procedures_path, only_path: true)
|
expect(page).to have_current_path(admin_procedures_path, only_path: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Finding archived procedures' do
|
scenario 'Finding archived procedures' do
|
||||||
page.find_by_id('archived-procedures').trigger('click')
|
page.find_by_id('archived-procedures').click
|
||||||
expect(page).to have_current_path(admin_procedures_archived_path, only_path: true)
|
expect(page).to have_current_path(admin_procedures_archived_path, only_path: true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -58,13 +58,13 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
||||||
page.find_by_id('procedure_types_de_champ_attributes_1_libelle')
|
page.find_by_id('procedure_types_de_champ_attributes_1_libelle')
|
||||||
expect(Procedure.first.types_de_champ.first.libelle).to eq('libelle de champ')
|
expect(Procedure.first.types_de_champ.first.libelle).to eq('libelle de champ')
|
||||||
|
|
||||||
page.find_by_id('onglet-pieces').trigger('click')
|
page.find_by_id('onglet-pieces').click
|
||||||
expect(page).to have_current_path(admin_procedure_pieces_justificatives_path(Procedure.first.id.to_s))
|
expect(page).to have_current_path(admin_procedure_pieces_justificatives_path(Procedure.first.id.to_s))
|
||||||
page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece'
|
page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece'
|
||||||
page.find_by_id('add_piece_justificative').click
|
page.find_by_id('add_piece_justificative').click
|
||||||
page.find_by_id('procedure_types_de_piece_justificative_attributes_1_libelle')
|
page.find_by_id('procedure_types_de_piece_justificative_attributes_1_libelle')
|
||||||
|
|
||||||
page.find_by_id('onglet-preview').trigger('click')
|
page.find_by_id('onglet-preview').click
|
||||||
expect(page).to have_current_path(admin_procedure_previsualisation_path(Procedure.first.id.to_s))
|
expect(page).to have_current_path(admin_procedure_previsualisation_path(Procedure.first.id.to_s))
|
||||||
expect(page.find("input[type='text']")['placeholder']).to eq('libelle de champ')
|
expect(page.find("input[type='text']")['placeholder']).to eq('libelle de champ')
|
||||||
expect(page.first('.piece-libelle').text).to eq('libelle de piece')
|
expect(page.first('.piece-libelle').text).to eq('libelle de piece')
|
||||||
|
@ -73,21 +73,21 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
||||||
scenario 'After adding champ and file, check impossibility to publish procedure, add accompagnateur and make publication' do
|
scenario 'After adding champ and file, check impossibility to publish procedure, add accompagnateur and make publication' do
|
||||||
page.find_by_id('procedure_types_de_champ_attributes_0_libelle').set 'libelle de champ'
|
page.find_by_id('procedure_types_de_champ_attributes_0_libelle').set 'libelle de champ'
|
||||||
page.find_by_id('add_type_de_champ').click
|
page.find_by_id('add_type_de_champ').click
|
||||||
page.find_by_id('onglet-pieces').trigger('click')
|
page.find_by_id('onglet-pieces').click
|
||||||
page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece'
|
page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece'
|
||||||
page.find_by_id('add_piece_justificative').click
|
page.find_by_id('add_piece_justificative').click
|
||||||
|
|
||||||
page.find_by_id('onglet-infos').trigger('click')
|
page.find_by_id('onglet-infos').click
|
||||||
expect(page).to have_current_path(admin_procedure_path(Procedure.first.id.to_s))
|
expect(page).to have_current_path(admin_procedure_path(Procedure.first.id.to_s))
|
||||||
expect(page.find_by_id('publish-procedure')['disabled']).to eq('disabled')
|
expect(page.find_by_id('publish-procedure')['disabled']).to eq('true')
|
||||||
|
|
||||||
page.find_by_id('onglet-accompagnateurs').trigger('click')
|
page.find_by_id('onglet-accompagnateurs').click
|
||||||
expect(page).to have_current_path(admin_procedure_accompagnateurs_path(Procedure.first.id.to_s))
|
expect(page).to have_current_path(admin_procedure_accompagnateurs_path(Procedure.first.id.to_s))
|
||||||
page.find_by_id('gestionnaire_email').set 'gestionnaire@apientreprise.fr'
|
page.find_by_id('gestionnaire_email').set 'gestionnaire@apientreprise.fr'
|
||||||
page.find_by_id('add-gestionnaire-email').click
|
page.find_by_id('add-gestionnaire-email').click
|
||||||
page.first('.gestionnaire-affectation').click
|
page.first('.gestionnaire-affectation').click
|
||||||
|
|
||||||
page.find_by_id('onglet-infos').trigger('click')
|
page.find_by_id('onglet-infos').click
|
||||||
expect(page).to have_selector('#publish-procedure', visible: true)
|
expect(page).to have_selector('#publish-procedure', visible: true)
|
||||||
page.find_by_id('publish-procedure').click
|
page.find_by_id('publish-procedure').click
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ feature 'user path for dossier creation' do
|
||||||
context 'when validating info entreprise recap page' do
|
context 'when validating info entreprise recap page' do
|
||||||
before do
|
before do
|
||||||
page.check('dossier_autorisation_donnees')
|
page.check('dossier_autorisation_donnees')
|
||||||
page.find_by_id('etape_suivante').trigger('click')
|
page.find_by_id('etape_suivante').click
|
||||||
end
|
end
|
||||||
scenario 'user is on description page' do
|
scenario 'user is on description page' do
|
||||||
expect(page).to have_css('#description-page')
|
expect(page).to have_css('#description-page')
|
||||||
|
@ -69,7 +69,7 @@ feature 'user path for dossier creation' do
|
||||||
context 'user fill and validate description page' do
|
context 'user fill and validate description page' do
|
||||||
before do
|
before do
|
||||||
page.find_by_id("champs_#{Dossier.last.champs.first.id}").set 'Mon super projet'
|
page.find_by_id("champs_#{Dossier.last.champs.first.id}").set 'Mon super projet'
|
||||||
page.find_by_id('suivant').trigger('click')
|
page.find_by_id('suivant').click
|
||||||
end
|
end
|
||||||
scenario 'user is on recap page' do
|
scenario 'user is on recap page' do
|
||||||
expect(page).to have_css('#users-recapitulatif-dossier-show')
|
expect(page).to have_css('#users-recapitulatif-dossier-show')
|
||||||
|
|
|
@ -55,14 +55,14 @@ feature 'As a User I wanna create a dossier' do
|
||||||
stub_request(:get, "https://staging.entreprise.api.gouv.fr/v2/associations/#{siret}?token=#{SIADETOKEN}")
|
stub_request(:get, "https://staging.entreprise.api.gouv.fr/v2/associations/#{siret}?token=#{SIADETOKEN}")
|
||||||
.to_return(status: 404, body: '')
|
.to_return(status: 404, body: '')
|
||||||
page.find_by_id('dossier-siret').set siret
|
page.find_by_id('dossier-siret').set siret
|
||||||
page.find_by_id('submit-siret').trigger('click')
|
page.find_by_id('submit-siret').click
|
||||||
expect(page).to have_css('#recap-info-entreprise')
|
expect(page).to have_css('#recap-info-entreprise')
|
||||||
find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
|
find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
|
||||||
page.find_by_id('etape_suivante').trigger('click')
|
page.find_by_id('etape_suivante').click
|
||||||
expect(page).to have_current_path(users_dossier_carte_path(procedure_with_siret.dossiers.last.id.to_s), only_path: true)
|
expect(page).to have_current_path(users_dossier_carte_path(procedure_with_siret.dossiers.last.id.to_s), only_path: true)
|
||||||
page.find_by_id('etape_suivante').trigger('click')
|
page.find_by_id('etape_suivante').click
|
||||||
fill_in "champs_#{procedure_with_siret.dossiers.last.champs.first.id}", with: 'contenu du champ 1'
|
fill_in "champs_#{procedure_with_siret.dossiers.last.champs.first.id}", with: 'contenu du champ 1'
|
||||||
page.find_by_id('suivant').trigger('click')
|
page.find_by_id('suivant').click
|
||||||
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_with_siret.dossiers.last.id.to_s), only_path: true)
|
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_with_siret.dossiers.last.id.to_s), only_path: true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,7 +37,7 @@ feature 'As a User I want to edit a dossier I own' do
|
||||||
linked_dossier_id = dossier.champs.find { |c| c.type_de_champ.type_champ == 'dossier_link' }.value
|
linked_dossier_id = dossier.champs.find { |c| c.type_de_champ.type_champ == 'dossier_link' }.value
|
||||||
expect(page).to have_link("Dossier #{linked_dossier_id}")
|
expect(page).to have_link("Dossier #{linked_dossier_id}")
|
||||||
|
|
||||||
page.find_by_id('maj_infos').trigger('click')
|
page.find_by_id('edit-dossier').click
|
||||||
expect(page).to have_current_path(users_dossier_description_path(dossier.id.to_s), only_path: true)
|
expect(page).to have_current_path(users_dossier_description_path(dossier.id.to_s), only_path: true)
|
||||||
champ_id = dossier.champs.find { |t| t.type_champ == "text" }.id
|
champ_id = dossier.champs.find { |t| t.type_champ == "text" }.id
|
||||||
fill_in "champs_#{champ_id.to_s}", with: 'Contenu du champ 1'
|
fill_in "champs_#{champ_id.to_s}", with: 'Contenu du champ 1'
|
||||||
|
|
|
@ -11,8 +11,8 @@ feature 'As a User I want to sort and paginate dossiers', js: true do
|
||||||
fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
|
fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
|
||||||
fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
|
fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
|
||||||
find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
|
find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
|
||||||
page.find_by_id('etape_suivante').trigger('click')
|
page.find_by_id('etape_suivante').click
|
||||||
page.find_by_id('suivant').trigger('click')
|
page.find_by_id('suivant').click
|
||||||
50.times do
|
50.times do
|
||||||
Dossier.create(procedure_id: procedure_for_individual.id, user_id: user.id, state: "en_construction")
|
Dossier.create(procedure_id: procedure_for_individual.id, user_id: user.id, state: "en_construction")
|
||||||
end
|
end
|
||||||
|
@ -35,15 +35,15 @@ feature 'As a User I want to sort and paginate dossiers', js: true do
|
||||||
scenario 'Using pagination' do
|
scenario 'Using pagination' do
|
||||||
visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc"
|
visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc"
|
||||||
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s)
|
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s)
|
||||||
page.find('.next_page a').trigger('click')
|
page.find('.next_page a').click
|
||||||
wait_for_ajax
|
wait_for_ajax
|
||||||
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 10).to_s)
|
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 10).to_s)
|
||||||
page.find('.next_page a').trigger('click')
|
page.find('.next_page a').click
|
||||||
wait_for_ajax
|
wait_for_ajax
|
||||||
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 20).to_s)
|
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 20).to_s)
|
||||||
page.find('.prev a').trigger('click')
|
page.find('.prev a').click
|
||||||
wait_for_ajax
|
wait_for_ajax
|
||||||
page.find('.prev a').trigger('click')
|
page.find('.prev a').click
|
||||||
wait_for_ajax
|
wait_for_ajax
|
||||||
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id).to_s)
|
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id).to_s)
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,10 +3,8 @@ require 'spec_helper'
|
||||||
describe Carto::Geocodeur do
|
describe Carto::Geocodeur do
|
||||||
let(:address) { '50 av des champs elysees' }
|
let(:address) { '50 av des champs elysees' }
|
||||||
describe '.convert_adresse_to_point', vcr: { cassette_name: 'bano_octo' } do
|
describe '.convert_adresse_to_point', vcr: { cassette_name: 'bano_octo' } do
|
||||||
if ENV['CIRCLECI'].nil?
|
it 'return a point' do
|
||||||
it 'return a point' do
|
expect(described_class.convert_adresse_to_point(address).class).to eq(RGeo::Cartesian::PointImpl)
|
||||||
expect(described_class.convert_adresse_to_point(address).class).to eq(RGeo::Cartesian::PointImpl)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
context 'when RestClient::Exception' do
|
context 'when RestClient::Exception' do
|
||||||
before do
|
before do
|
||||||
|
|
|
@ -28,11 +28,22 @@ require 'shoulda-matchers'
|
||||||
require 'devise'
|
require 'devise'
|
||||||
require 'factory_girl'
|
require 'factory_girl'
|
||||||
|
|
||||||
require 'capybara/poltergeist'
|
require 'selenium/webdriver'
|
||||||
Capybara.javascript_driver = :poltergeist
|
Capybara.javascript_driver = :headless_chrome
|
||||||
Capybara.ignore_hidden_elements = false
|
Capybara.ignore_hidden_elements = false
|
||||||
Capybara.register_driver :poltergeist do |app|
|
|
||||||
Capybara::Poltergeist::Driver.new(app, js_errors: true, port: 44_678, phantomjs_options: ['--proxy-type=none'], timeout: 180)
|
Capybara.register_driver :chrome do |app|
|
||||||
|
Capybara::Selenium::Driver.new(app, browser: :chrome)
|
||||||
|
end
|
||||||
|
|
||||||
|
Capybara.register_driver :headless_chrome do |app|
|
||||||
|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
|
||||||
|
chromeOptions: { args: %w(headless disable-gpu window-size=2560,1600) }
|
||||||
|
)
|
||||||
|
|
||||||
|
Capybara::Selenium::Driver.new app,
|
||||||
|
browser: :chrome,
|
||||||
|
desired_capabilities: capabilities
|
||||||
end
|
end
|
||||||
|
|
||||||
ActiveSupport::Deprecation.silenced = true
|
ActiveSupport::Deprecation.silenced = true
|
||||||
|
|
Loading…
Reference in a new issue