diff --git a/spec/features/Add_UV b/spec/features/Add_UV new file mode 100644 index 0000000..9b1a156 --- /dev/null +++ b/spec/features/Add_UV @@ -0,0 +1,18 @@ +require 'spec_helper' + +feature 'Add UV' do + + $corpus = a_string + + scenario 'for create a new corpus' do + visit $home_page + click_on 'Se connecter' + log_in_as 'alice', 'lapinblanc' + toggle_edit + click_plus_sign_next_to 'Corpus' + click_last 'Corpus' + type $corpus, : return + expect(page).to have_content($corpus) + end + +end diff --git a/spec/features/Research_by_attribute b/spec/features/Research_by_attribute new file mode 100644 index 0000000..172ea2c --- /dev/null +++ b/spec/features/Research_by_attribute @@ -0,0 +1,25 @@ +feature 'Research by attribute' do + + scenario 'for search UV by responsible' do + visit '/' + click_on 'Rechercher par attributs' + select 'UV', :from => 'Corpus' + select 'Responsable', :from => 'Nom' + select 'Marc Lemercier', :from => 'Valeur' + click_on 'Rechercher' + click_on 'NF19...' + end + + scenario 'for search UV by two intervenants' do + visit '/' + click_on 'Rechercher par attributs' + select 'UV', :from => 'Corpus' + select 'Intervenant', :from => 'Nom' + select 'Ines Di Loreto', :from => 'Valeur' + click_on '+' + select 'Intervenant', :from => 'Nom' + select 'Pascal Salembier', :from => 'Valeur' + click_on 'Rechercher' + click_on 'IF10...' + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 87ddc79..23ca72d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,16 +1,13 @@ require 'capybara/rspec' -require 'capybara/poltergeist' +require 'capybara/webkit' Capybara.run_server = false -Capybara.default_driver = :poltergeist -Capybara.app_host = "http://agorae.test.hypertopic.org" +Capybara.default_driver = :webkit +Capybara.default_wait_time = 5 +Capybara.app_host ='http://agorae.test.hypertopic.org/#http://agorae.test.hypertopic.org/argos/item/cd48c7fdc83cb4ab1a61f574a631d4ec/5329d9bc4c34fd2ef8ccb896004e0a0a' $home_page = '/' -def in_dialog() - find('#dialog') -end - def log_in_as(login, password) fill_in "Nom d'utilisateur", :with => login fill_in 'Mot de passe', :with => password @@ -18,10 +15,20 @@ def log_in_as(login, password) expect(page).not_to have_content 'Connectez-vous' end +def type(*keys_sequences) + keys_sequences.each do |s| + find('input[type=textbox]').native.send_keys s + end +end + def toggle_edit() find('#toggle').click end +def a_string() + s = ('a'..'z').to_a.shuffle[0,8].join +end + def click_plus_sign_next_to(list) find(".#{list}-list .add").click end @@ -29,17 +36,3 @@ def click_plus_sign_next_to(list) def click_last(list) find("##{list} li:last-child .editable").click end - -def click_on_link(text) - find('span', :text => "#{text}").click -end - -def type(*keys_sequences) - keys_sequences.each do |s| - find('input[type=textbox]').native.send_keys s - end -end - -def a_string() - s = ('a'..'z').to_a.shuffle[0,8].join -end