From 710944b323bcb53fbb875ee42eb2c6b9977ea074 Mon Sep 17 00:00:00 2001 From: "maxim.joseau" Date: Wed, 23 Oct 2024 11:27:34 +0200 Subject: [PATCH] wip: test ci fix: resolve VCR cassette usage and sync GraphQL schema comparison fix: increase field count fix: add wait time for cassette taking too long fix: add BASEROW_URL to Dockerfile fix: add BASEROW_CONFIG_TABLE to Dockerfile fix: add var to ci fix: remove useless file fix: env in ci fix: increase max_wait_time of capybara due to slow DOM --- .github/workflows/ci.yml | 8 +++ Dockerfile | 4 +- app/graphql/api/v2/schema.rb | 2 + app/graphql/schema.graphql | 60 +++++++++++++++++++ app/graphql/types/champ_descriptor_type.rb | 2 + app/graphql/types/champ_type.rb | 2 + ...tiel_de_polynesie_champ_descriptor_type.rb | 5 ++ .../referentiel_de_polynesie_champ_type.rb | 21 +++++++ config/env.example | 3 + config/locales/models/type_de_champ/fr.yml | 1 + config/secrets.yml | 3 - ..._dossier_with_referentiel_de_polynesie.yml | 8 +-- .../cassettes/baserow}/baserow404_error.yml | 0 .../baserow}/baserow_api_available_tables.yml | 0 .../cassettes/baserow}/baserow_fetch_row.yml | 0 .../cassettes/baserow}/baserow_search.yml | 0 ...0220705164551_remove_unused_champs_spec.rb | 4 +- .../baserow_api_spec.rb | 55 +++++++---------- spec/rails_helper.rb | 7 --- spec/support/capybara.rb | 2 +- .../administrateurs/types_de_champ_spec.rb | 4 +- spec/system/users/brouillon_spec.rb | 10 ++-- .../baserow_available_tables.yml | 49 --------------- 23 files changed, 146 insertions(+), 104 deletions(-) create mode 100644 app/graphql/types/champs/descriptor/referentiel_de_polynesie_champ_descriptor_type.rb create mode 100644 app/graphql/types/champs/referentiel_de_polynesie_champ_type.rb rename spec/{vcr_cassettes => fixtures/cassettes}/The_user/fill_a_dossier_with_referentiel_de_polynesie.yml (95%) rename spec/{vcr_cassettes => fixtures/cassettes/baserow}/baserow404_error.yml (100%) rename spec/{vcr_cassettes => fixtures/cassettes/baserow}/baserow_api_available_tables.yml (100%) rename spec/{vcr_cassettes => fixtures/cassettes/baserow}/baserow_fetch_row.yml (100%) rename spec/{vcr_cassettes => fixtures/cassettes/baserow}/baserow_search.yml (100%) delete mode 100644 spec/vcr_cassettes/baserow_available_tables.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ee2f6b7d37..65de31640b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,10 @@ jobs: timeout-minutes: 20 env: RUBY_YJIT_ENABLE: "1" + API_BASEROW_URL: "https://api.baserow.io" + API_BASEROW_TOKEN: ${{ secrets.API_BASEROW_TOKEN }} + API_BASEROW_USER: ${{ secrets.API_BASEROW_USER }} + API_BASEROW_CONFIG_TABLE: "202600" services: postgres: image: postgis/postgis:14-3.3 @@ -124,6 +128,10 @@ jobs: timeout-minutes: 20 env: RUBY_YJIT_ENABLE: "1" + API_BASEROW_URL: "https://api.baserow.io" + API_BASEROW_TOKEN: ${{ secrets.API_BASEROW_TOKEN }} + API_BASEROW_USER: ${{ secrets.API_BASEROW_USER }} + API_BASEROW_CONFIG_TABLE: "202600" services: postgres: image: postgis/postgis:14-3.3 diff --git a/Dockerfile b/Dockerfile index bb95567f1c9..3f0950c8a85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -203,7 +203,9 @@ ENV \ WATERMARK_FILE="watermark_pf.png"\ WEASYPRINT_URL="http://weasyprint:5000/pdf"\ YAHOO_CLIENT_ID=""\ - YAHOO_CLIENT_SECRET="" + YAHOO_CLIENT_SECRET=""\ + API_BASEROW_URL="https://api.baserow.io"\ + API_BASEROW_CONFIG_TABLE="202600" COPY --chown=userapp:userapp . ${APP_PATH} RUN rm -fr .git diff --git a/app/graphql/api/v2/schema.rb b/app/graphql/api/v2/schema.rb index 7ea4970f132..6758dd4ccf1 100644 --- a/app/graphql/api/v2/schema.rb +++ b/app/graphql/api/v2/schema.rb @@ -79,6 +79,7 @@ def self.resolve_type(type_definition, object, ctx) Types::Champs::TextChampType, Types::Champs::TitreIdentiteChampType, Types::Champs::VisaChampType, + Types::Champs::ReferentielDePolynesieChampType, Types::Champs::EngagementJuridiqueChampType, Types::GeoAreas::ParcelleCadastraleType, Types::GeoAreas::SelectionUtilisateurType, @@ -128,6 +129,7 @@ def self.resolve_type(type_definition, object, ctx) Types::Champs::Descriptor::TextChampDescriptorType, Types::Champs::Descriptor::TitreIdentiteChampDescriptorType, Types::Champs::Descriptor::VisaChampDescriptorType, + Types::Champs::Descriptor::ReferentielDePolynesieChampDescriptorType, Types::Champs::Descriptor::YesNoChampDescriptorType, Types::Champs::Descriptor::ExpressionReguliereChampDescriptorType, Types::Champs::Descriptor::EngagementJuridiqueChampDescriptorType diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index c17e8a43014..c1bd2bcd7da 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -4142,6 +4142,61 @@ type RNFChampDescriptor implements ChampDescriptor { type: TypeDeChamp! @deprecated(reason: "Utilisez le champ `__typename` à la place.") } +type ReferentielDePolynesieChamp implements Champ { + """ + L'identifiant du champDescriptor de ce champ + """ + champDescriptorId: String! + id: ID! + + """ + Libellé du champ. + """ + label: String! + prefilled: Boolean! + searchField: String + selectedValue: String + + """ + La valeur du champ sous forme texte. + """ + stringValue: String + tableId: ID + + """ + Date de dernière modification du champ. + """ + updatedAt: ISO8601DateTime! +} + +type ReferentielDePolynesieChampDescriptor implements ChampDescriptor { + """ + Description des champs d’un bloc répétable. + """ + champDescriptors: [ChampDescriptor!] @deprecated(reason: "Utilisez le champ `RepetitionChampDescriptor.champ_descriptors` à la place.") + + """ + Description du champ. + """ + description: String + id: ID! + + """ + Libellé du champ. + """ + label: String! + + """ + Est-ce que le champ est obligatoire ? + """ + required: Boolean! + + """ + Type de la valeur du champ. + """ + type: TypeDeChamp! @deprecated(reason: "Utilisez le champ `__typename` à la place.") +} + type Region { code: String! name: String! @@ -4748,6 +4803,11 @@ enum TypeDeChamp { """ pole_emploi + """ + Référentiel de Polynésie + """ + referentiel_de_polynesie + """ Régions """ diff --git a/app/graphql/types/champ_descriptor_type.rb b/app/graphql/types/champ_descriptor_type.rb index 803ca17d8ac..650883a940b 100644 --- a/app/graphql/types/champ_descriptor_type.rb +++ b/app/graphql/types/champ_descriptor_type.rb @@ -35,6 +35,8 @@ def resolve_type(object, context) Types::Champs::Descriptor::TeFenuaChampDescriptorType when TypeDeChamp.type_champs.fetch(:visa) Types::Champs::Descriptor::VisaChampDescriptorType + when TypeDeChamp.type_champs.fetch(:referentiel_de_polynesie) + Types::Champs::Descriptor::ReferentielDePolynesieChampDescriptorType # ----- DS champs when TypeDeChamp.type_champs.fetch(:engagement_juridique) diff --git a/app/graphql/types/champ_type.rb b/app/graphql/types/champ_type.rb index 642f73c418b..26603a4681b 100644 --- a/app/graphql/types/champ_type.rb +++ b/app/graphql/types/champ_type.rb @@ -90,6 +90,8 @@ def resolve_type(object, context) Types::Champs::TitreIdentiteChampType when ::Champs::VisaChamp Types::Champs::VisaChampType + when ::Champs::ReferentielDePolynesieChamp + Types::Champs::ReferentielDePolynesieChampType when ::Champs::EpciChamp Types::Champs::EpciChampType when ::Champs::RNAChamp diff --git a/app/graphql/types/champs/descriptor/referentiel_de_polynesie_champ_descriptor_type.rb b/app/graphql/types/champs/descriptor/referentiel_de_polynesie_champ_descriptor_type.rb new file mode 100644 index 00000000000..22b3fd07a5f --- /dev/null +++ b/app/graphql/types/champs/descriptor/referentiel_de_polynesie_champ_descriptor_type.rb @@ -0,0 +1,5 @@ +module Types::Champs::Descriptor + class ReferentielDePolynesieChampDescriptorType < Types::BaseObject + implements Types::ChampDescriptorType + end +end diff --git a/app/graphql/types/champs/referentiel_de_polynesie_champ_type.rb b/app/graphql/types/champs/referentiel_de_polynesie_champ_type.rb new file mode 100644 index 00000000000..bfab98e5838 --- /dev/null +++ b/app/graphql/types/champs/referentiel_de_polynesie_champ_type.rb @@ -0,0 +1,21 @@ +module Types::Champs + class ReferentielDePolynesieChampType < Types::BaseObject + implements Types::ChampType + + field :selected_value, String, null: true + field :table_id, ID, null: true + field :search_field, String, null: true + + def selected_value + object.value + end + + def table_id + object.table_id + end + + def search_field + object.search_field + end + end +end diff --git a/config/env.example b/config/env.example index 0dd07c471b0..0e39680c051 100644 --- a/config/env.example +++ b/config/env.example @@ -159,3 +159,6 @@ STRICT_EMAIL_VALIDATION_STARTS_ON="2024-02-19" # Weasyprint endpoint generating attestations v2 # See https://github.com/demarches-simplifiees/weasyprint_server WEASYPRINT_URL="http://127.0.0.1:5000/pdf" + +API_BASEROW_URL="https://api.baserow.io" +API_BASEROW_CONFIG_TABLE="202600" diff --git a/config/locales/models/type_de_champ/fr.yml b/config/locales/models/type_de_champ/fr.yml index c72f386f43f..9f00cf6178d 100644 --- a/config/locales/models/type_de_champ/fr.yml +++ b/config/locales/models/type_de_champ/fr.yml @@ -20,6 +20,7 @@ fr: numero_dn: 'Numéro DN' te_fenua: 'Carte de Polynésie' visa: 'Visa' + referentiel_de_polynesie: 'Référentiel de Polynésie' header_section: 'Titre de section' repetition: 'Bloc répétable' dossier_link: 'Lien vers un autre dossier' diff --git a/config/secrets.yml b/config/secrets.yml index 76d4b682be3..3e8eaaef59a 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -135,10 +135,7 @@ defaults: &defaults userpwd: <%= ENV['CERTIGNA_USERPWD'] %> baserow: url: <%= ENV['API_BASEROW_URL'] %> - token: <%= ENV['API_BASEROW_TOKEN'] %> - user: <%= ENV['API_BASEROW_USER'] %> config_table: <%= ENV['API_BASEROW_CONFIG_TABLE'] %> - password: "<%= ENV['API_BASEROW_PASSWORD'] %>" autocomplete: api_geo_url: <%= ENV['API_GEO_URL'] %> api_adresse_url: <%= ENV['API_ADRESSE_URL'] %> diff --git a/spec/vcr_cassettes/The_user/fill_a_dossier_with_referentiel_de_polynesie.yml b/spec/fixtures/cassettes/The_user/fill_a_dossier_with_referentiel_de_polynesie.yml similarity index 95% rename from spec/vcr_cassettes/The_user/fill_a_dossier_with_referentiel_de_polynesie.yml rename to spec/fixtures/cassettes/The_user/fill_a_dossier_with_referentiel_de_polynesie.yml index 3a08b085ddc..315a41acf98 100644 --- a/spec/vcr_cassettes/The_user/fill_a_dossier_with_referentiel_de_polynesie.yml +++ b/spec/fixtures/cassettes/The_user/fill_a_dossier_with_referentiel_de_polynesie.yml @@ -27,7 +27,7 @@ http_interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Mon, 21 Oct 2024 18:22:13 GMT + - Wed, 23 Oct 2024 09:19:45 GMT Referrer-Policy: - same-origin Server: @@ -45,7 +45,7 @@ http_interactions: encoding: ASCII-8BIT string: !binary |- eyJpZCI6MSwib3JkZXIiOiIxLjAwMDAwMDAwMDAwMDAwMDAwMDAwIiwiTm9tIjoiQ29tbXVuZXMgZGUgcG9seW7DqXNpZSIsIk5vdGVzIjoiIiwiQWN0aWYiOnRydWUsIlRhYmxlIjoiMjAyNTc4IiwiQ2hhbXBzIHVzYWdlciI6IjEzOTE3NDcsMTM5MTc1MCwxMzkxNzU1LDEzOTE3NTYiLCJDaGFtcCBkZSByZWNoZXJjaGUiOiIxMzkxNzQ3IiwiQ2hhbXBzIGluc3RydWN0ZXVyIjoiMTM5MTc0NywxMzkxNzUwLDEzOTE3NTUsMTM5MTc1NiIsIlRva2VuIjoiVHFkbEhQY2x3SmtFb3VNTGp0aUZPY21LamdzRFd0YUwifQ== - recorded_at: Mon, 21 Oct 2024 18:22:12 GMT + recorded_at: Wed, 23 Oct 2024 09:19:44 GMT - request: method: get uri: https://api.baserow.io/api/database/rows/table/202578/?filter__field_1391747__contains=Mahina @@ -73,7 +73,7 @@ http_interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Mon, 21 Oct 2024 18:22:14 GMT + - Wed, 23 Oct 2024 09:19:45 GMT Referrer-Policy: - same-origin Server: @@ -98,5 +98,5 @@ http_interactions: - Mahina - Tahiti - 98710"}],"field_1391765":[{"id":7,"value":"Tahiti"}]},{"id":164,"order":"164.00000000000000000000","field_1391747":"Pukapuka - Teonemahina - 98774","field_1391748":"Pukapuka","field_1391749":"98774","field_1391750":null,"field_1391751":"Teonemahina","field_1391754":[{"ids":{"database_table_202575":5,"database_table_202576":85},"value":"Tuamotu-Gambiers"}],"field_1391755":"Pukapuka","field_1391756":[{"id":85,"value":"Pukapuka - Teonemahina - 98774"}],"field_1391765":[{"id":85,"value":"Pukapuka"}]}]}' - recorded_at: Mon, 21 Oct 2024 18:22:13 GMT + recorded_at: Wed, 23 Oct 2024 09:19:44 GMT recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/baserow404_error.yml b/spec/fixtures/cassettes/baserow/baserow404_error.yml similarity index 100% rename from spec/vcr_cassettes/baserow404_error.yml rename to spec/fixtures/cassettes/baserow/baserow404_error.yml diff --git a/spec/vcr_cassettes/baserow_api_available_tables.yml b/spec/fixtures/cassettes/baserow/baserow_api_available_tables.yml similarity index 100% rename from spec/vcr_cassettes/baserow_api_available_tables.yml rename to spec/fixtures/cassettes/baserow/baserow_api_available_tables.yml diff --git a/spec/vcr_cassettes/baserow_fetch_row.yml b/spec/fixtures/cassettes/baserow/baserow_fetch_row.yml similarity index 100% rename from spec/vcr_cassettes/baserow_fetch_row.yml rename to spec/fixtures/cassettes/baserow/baserow_fetch_row.yml diff --git a/spec/vcr_cassettes/baserow_search.yml b/spec/fixtures/cassettes/baserow/baserow_search.yml similarity index 100% rename from spec/vcr_cassettes/baserow_search.yml rename to spec/fixtures/cassettes/baserow/baserow_search.yml diff --git a/spec/lib/tasks/deployment/20220705164551_remove_unused_champs_spec.rb b/spec/lib/tasks/deployment/20220705164551_remove_unused_champs_spec.rb index c428c6c3314..33f215fa06f 100644 --- a/spec/lib/tasks/deployment/20220705164551_remove_unused_champs_spec.rb +++ b/spec/lib/tasks/deployment/20220705164551_remove_unused_champs_spec.rb @@ -3,7 +3,7 @@ let(:procedure) { create(:procedure, :with_all_champs) } let(:dossier) { create(:dossier, :with_populated_champs, procedure: procedure) } let(:champ_repetition) { dossier.champs_public.find(&:repetition?) } - let(:champ_count) { 50 } + let(:champ_count) { 51 } subject(:run_task) do dossier @@ -16,7 +16,9 @@ describe 'remove_unused_champs' do it "with bad champs" do expect(Champ.where(dossier: dossier).count).to eq(champ_count) + run_task + expect(Champ.where(dossier: dossier).count).to eq(champ_count - 1) end end diff --git a/spec/models/referentiel_de_polynesie/baserow_api_spec.rb b/spec/models/referentiel_de_polynesie/baserow_api_spec.rb index fe0e46682ac..5586cb9c38d 100644 --- a/spec/models/referentiel_de_polynesie/baserow_api_spec.rb +++ b/spec/models/referentiel_de_polynesie/baserow_api_spec.rb @@ -1,72 +1,63 @@ require 'rails_helper' require 'webmock/rspec' -require 'vcr' RSpec.describe ReferentielDePolynesie::BaserowAPI, type: :model do describe '#search' do - it 'search in a Baserow table and return the result', :vcr do + it 'searches in a Baserow table and returns the result', vcr: { cassette_name: 'baserow/baserow_search' } do allow(ReferentielDePolynesie::BaserowAPI).to receive(:config).and_return({ 'Table' => '202600', 'Champ de recherche' => 'search_field', 'Token' => ENV['API_BASEROW_TOKEN'].to_s }) - VCR.use_cassette('baserow_search') do - results = ReferentielDePolynesie::BaserowAPI.search(123, "term") + results = ReferentielDePolynesie::BaserowAPI.search(123, "term") - expect(results).to be_an(Array) - expect(results.length).to be > 0 - expect(results.first).to have_key(:name) - expect(results.first).to have_key(:id) - end + expect(results).to be_an(Array) + expect(results.length).to be > 0 + expect(results.first).to have_key(:name) + expect(results.first).to have_key(:id) end end describe '#fetch_row' do - it 'fetch a specific line in a Baserow table', :vcr do + it 'fetches a specific line in a Baserow table', vcr: { cassette_name: 'baserow/baserow_fetch_row' } do allow(ReferentielDePolynesie::BaserowAPI).to receive(:config).and_return({ 'Table' => '202600', 'Token' => ENV['API_BASEROW_TOKEN'].to_s }) - VCR.use_cassette('baserow_fetch_row') do - result = ReferentielDePolynesie::BaserowAPI.fetch_row(123, 1) + result = ReferentielDePolynesie::BaserowAPI.fetch_row(123, 1) - expect(result[:row]["Nom"]).to eq("Communes de polynésie") - expect(result[:row]["Notes"]).to eq("") - expect(result[:row]["Actif"]).to eq(true) - expect(result[:row]["Table"]).to eq("202578") - expect(result[:row]["Champs usager"]).to eq("1391747,1391750,1391755,1391756") - expect(result[:row]["Champ de recherche"]).to eq("1391747") - expect(result[:row]["Champs instructeur"]).to eq("1391747,1391750,1391755,1391756") - end + expect(result[:row]["Nom"]).to eq("Communes de polynésie") + expect(result[:row]["Notes"]).to eq("") + expect(result[:row]["Actif"]).to eq(true) + expect(result[:row]["Table"]).to eq("202578") + expect(result[:row]["Champs usager"]).to eq("1391747,1391750,1391755,1391756") + expect(result[:row]["Champ de recherche"]).to eq("1391747") + expect(result[:row]["Champs instructeur"]).to eq("1391747,1391750,1391755,1391756") end - it 'return a 404 error if the row does not exist', :vcr do + it 'returns a 404 error if the row does not exist', vcr: { cassette_name: 'baserow/baserow404_error' } do allow(ReferentielDePolynesie::BaserowAPI).to receive(:config).and_return({ 'Table' => '202600', 'Token' => ENV['API_BASEROW_TOKEN'].to_s }) - VCR.use_cassette('baserow404_error') do - results = ReferentielDePolynesie::BaserowAPI.fetch_row(123, 99999) + results = ReferentielDePolynesie::BaserowAPI.fetch_row(123, 99999) - expect(results).to eq(nil) - end + expect(results).to eq(nil) end end describe '#available_tables' do - it 'fetch the available tables', :vcr do + it 'fetches the available tables', vcr: { cassette_name: 'baserow/baserow_api_available_tables' } do allow(ReferentielDePolynesie::BaserowAPI).to receive(:config) - VCR.use_cassette('baserow_available_tables') do - results = ReferentielDePolynesie::BaserowAPI.available_tables + results = ReferentielDePolynesie::BaserowAPI.available_tables - expect(results).to be_an(Array) - expect(results.first[:name]).to eq("Communes de polynésie") - expect(results.first[:id]).to eq(1) - end + expect(results).to be_an(Array) + expect(results.first[:name]).to eq("Communes de polynésie") + expect(results.first[:id]).to eq(1) end end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index c7d15ef1ea5..331e66a034c 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -122,13 +122,6 @@ end end - VCR.configure do |config| - config.cassette_library_dir = 'spec/vcr_cassettes' - config.hook_into :webmock - config.configure_rspec_metadata! - config.allow_http_connections_when_no_cassette = false - end - config.include ActiveSupport::Testing::TimeHelpers config.include Shoulda::Matchers::ActiveRecord, type: :model config.include Shoulda::Matchers::ActiveModel, type: :model diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index a29cf8eb7c7..de235c3515e 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -55,7 +55,7 @@ def setup_driver(app, download_path, options) setup_driver(app, download_path, options) end -Capybara.default_max_wait_time = 4 +Capybara.default_max_wait_time = 10 Capybara.ignore_hidden_elements = false diff --git a/spec/system/administrateurs/types_de_champ_spec.rb b/spec/system/administrateurs/types_de_champ_spec.rb index 0911550de2e..e77489012ac 100644 --- a/spec/system/administrateurs/types_de_champ_spec.rb +++ b/spec/system/administrateurs/types_de_champ_spec.rb @@ -210,10 +210,10 @@ before { Flipper.enable(:referentiel_de_polynesie, administrateur.user) } it "add referentiel_de_polynesie champ" do - VCR.use_cassette('baserow_api_available_tables', record: :new_episodes) do + VCR.use_cassette('baserow/baserow_api_available_tables', record: :new_episodes) do add_champ - select('Referentiel De Polynesie', from: 'Type de champ') + select('Référentiel de Polynésie', from: 'Type de champ') fill_in 'Libellé du champ', with: 'Libellé de champ Référentiel de Polynésie', fill_options: { clear: :backspace } expect(page).to have_content('Formulaire enregistré') diff --git a/spec/system/users/brouillon_spec.rb b/spec/system/users/brouillon_spec.rb index 2f40517e428..3a6740d87db 100644 --- a/spec/system/users/brouillon_spec.rb +++ b/spec/system/users/brouillon_spec.rb @@ -38,16 +38,18 @@ select('02 – Aisne', from: form_id_for('departements')) fill_in('communes', with: '60400') - find('li', text: 'Brétigny (60400)').click - wait_until { champ_value_for('communes') == "Brétigny" } + using_wait_time 20 do + find('li', text: 'Brétigny (60400)').click + end select('Australienne', from: form_id_for('nationalites')) select('Mahina - Tahiti - 98709', from: form_id_for('commune_de_polynesie')) select('98709 - Mahina - Tahiti', from: form_id_for('code_postal_de_polynesie')) fill_in('address', with: '78 Rue du Grés 30310 Vergè') - find('li', text: '78 Rue du Grés 30310 Vergèze').click - wait_until { champ_value_for('address') == '78 Rue du Grés 30310 Vergèze' } + using_wait_time 20 do + find('li', text: '78 Rue du Grés 30310 Vergèze').click + end wait_until { champ_for('address').full_address? } expect(champ_for('address').departement_code_and_name).to eq('30 – Gard') diff --git a/spec/vcr_cassettes/baserow_available_tables.yml b/spec/vcr_cassettes/baserow_available_tables.yml deleted file mode 100644 index 28e57b434f6..00000000000 --- a/spec/vcr_cassettes/baserow_available_tables.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.baserow.io/api/database/rows/table/202600/?user_field_names=true - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - mes-demarches.gov.pf - Authorization: - - Token TqdlHPclwJkEouMLjtiFOcmKjgsDWtaL - Expect: - - '' - response: - status: - code: 200 - message: '' - headers: - Allow: - - GET, POST, HEAD, OPTIONS - Alt-Svc: - - h3=":443"; ma=2592000 - Content-Type: - - application/json - Cross-Origin-Opener-Policy: - - same-origin - Date: - - Wed, 16 Oct 2024 10:46:54 GMT - Referrer-Policy: - - same-origin - Server: - - Caddy - - gunicorn - Vary: - - origin - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - Content-Length: - - '1668' - body: - encoding: ASCII-8BIT - string: !binary |- - eyJjb3VudCI6NywibmV4dCI6bnVsbCwicHJldmlvdXMiOm51bGwsInJlc3VsdHMiOlt7ImlkIjoxLCJvcmRlciI6IjEuMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJOb20iOiJDb21tdW5lcyBkZSBwb2x5bsOpc2llIiwiTm90ZXMiOiIiLCJBY3RpZiI6dHJ1ZSwiVGFibGUiOiIyMDI1NzgiLCJDaGFtcHMgdXNhZ2VyIjoiMTM5MTc0NywxMzkxNzUwLDEzOTE3NTUsMTM5MTc1NiIsIkNoYW1w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