Last active
March 12, 2019 09:49
Revisions
-
PharaohKJ revised this gist
Mar 12, 2019 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,4 +30,18 @@ within でスコープを区切る pp [i, e.text] end end ``` ネストもできる (https://github.com/gongo/maizebox/blob/master/examples/runner.rb) ``` within(:css, 'aside') do within(:css, 'li.first-child') do page.attention_here end within(:css, 'li.third-child') do page.attention_to(find(:css, 'img')) end end ``` -
PharaohKJ revised this gist
Mar 12, 2019 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,4 +17,17 @@ page.all('div', text: /\Aテキスト\z/) assert_selector('div', text: /\Aテキスト\z/, count: 1) page.all('tr.order-record').count assert_selector('.order-record', count: 2) ``` ## 子ノードをセレクトしたい within でスコープを区切る ``` element = page.all('tr.order-record')[0] within(element) do page.all('td').each_with_index do |e, i| pp [i, e.text] end end ``` -
PharaohKJ revised this gist
Mar 12, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,7 @@ https://github.com/mugi-uno/nezumi ``` fill_in 'staff_password', with: 'password' click_on 'LOGIN' find_button('発注する').click # findでみつかるまでwaitが入る模様 -> see https://www.rubydoc.info/github/jnicklas/capybara/Capybara%2FNode%2FFinders:find_button ``` # セレクタ -
PharaohKJ revised this gist
Mar 12, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,4 +14,6 @@ https://github.com/mugi-uno/nezumi ``` page.all('div', text: /\Aテキスト\z/) assert_selector('div', text: /\Aテキスト\z/, count: 1) page.all('tr.order-record').count assert_selector('.order-record', count: 2) ``` -
PharaohKJ revised this gist
Mar 12, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,4 +14,4 @@ https://github.com/mugi-uno/nezumi ``` page.all('div', text: /\Aテキスト\z/) assert_selector('div', text: /\Aテキスト\z/, count: 1) ``` -
PharaohKJ renamed this gist
Mar 12, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
PharaohKJ created this gist
Mar 12, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ # ツール https://github.com/mugi-uno/nezumi # 入力 ``` fill_in 'staff_password', with: 'password' click_on 'LOGIN' ``` # セレクタ ``` page.all('div', text: /\Aテキスト\z/) assert_selector('div', text: /\Aテキスト\z/, count: 1) ``