Sha256: 9c79169bd69067f228d4d77f964b8d227754345e272ded8a100798ec1aa1158c
Contents?: true
Size: 1.68 KB
Versions: 26
Compression:
Stored size: 1.68 KB
Contents
require 'spec_helper' describe 'Jobs Dashboard', type: :feature, js: true, capybara: true do it 'filters out usernames other than the one specified in the search box' do other_user = Marty::User.create(login: 'other', firstname: 'other', lastname: 'other', active: true) Marty::Promise.create title: "Test Job 1", user: Marty::User.find_by(login: 'marty'), cformat: 'csv', start_dt: Time.now Marty::Promise.create title: "Test Job 2", user: other_user, cformat: 'csv', start_dt: Time.now visit "/" all 'span', text: 'Sign in', minimum: 1 find(ext_button_id('Sign in')).click fill_in 'Login', with: 'marty' fill_in 'Password', with: 'marty' find(:xpath, '//a[contains(., "OK")]').click expect(page).to have_content('marty marty') find(ext_button_id('Applications')).click find(ext_menuitem_id('Jobs Dashboard')).click page_title = I18n.t("jobs.promise_view") expect(page).to have_content(page_title) sleep 1 expect(tree_row_count(page_title)).to eq(2) fill_in "live_search_text", with: 'marty' sleep 1 expect(tree_row_count(page_title)).to eq(1) end def ext_button_id title id = page.evaluate_script("Ext.ComponentQuery.query(\"button{isVisible(true)}[text='#{title}']\")[0].id") "##{id}" end def ext_menuitem_id title id = page.evaluate_script("Ext.ComponentQuery.query(\"menuitem[text='#{title}']\")[0].id") "##{id}" end def tree_row_count name page.evaluate_script("Ext.ComponentQuery.query('treepanel[title=\"#{name}\"]')[0].getStore().getCount()") end end
Version data entries
26 entries across 26 versions & 1 rubygems