diff --git a/example/desktop web/desktop_web_gmail_login/features/gmail_login.feature b/example/desktop web/desktop_web_gmail_login/features/gmail_login.feature index a1e2a66..5f07c0f 100644 --- a/example/desktop web/desktop_web_gmail_login/features/gmail_login.feature +++ b/example/desktop web/desktop_web_gmail_login/features/gmail_login.feature @@ -8,3 +8,4 @@ Feature: Gmail_login When I click on element having id "signIn" And I wait for 10 sec Then I close browser + And user succesfully login in bukalapak \ No newline at end of file diff --git a/lib/selenium-cucumber/assertion_steps.rb b/lib/selenium-cucumber/assertion_steps.rb index 5402b39..4267187 100644 --- a/lib/selenium-cucumber/assertion_steps.rb +++ b/lib/selenium-cucumber/assertion_steps.rb @@ -76,6 +76,10 @@ check_alert_text(actual_value) end +Then(/^I link having text "(.*?)" should\s*((?:not)?)\s+be present$/) do |access_name, present| + check_element_presence('link', access_name, present.empty?) +end + # step to assert dropdown list Then(/^option "(.*?)" by (.+) from dropdown having (.+) "(.*?)" should be (selected|unselected)$/) do |option, by, type, access_name, state| validate_locator type @@ -87,3 +91,5 @@ Then(/^actual image having (.+) "(.*?)" and expected image having (.+) "(.*?)" should be similar$/) do |actual_img_access_type, actual_img_access_name, excp_img_access_type, excp_img_access_name| does_images_similar?(actual_img_access_type, actual_img_access_name, excp_img_access_type, excp_img_access_name) end + + diff --git a/lib/selenium-cucumber/click_elements_steps.rb b/lib/selenium-cucumber/click_elements_steps.rb index be4b682..0f7a83c 100644 --- a/lib/selenium-cucumber/click_elements_steps.rb +++ b/lib/selenium-cucumber/click_elements_steps.rb @@ -34,6 +34,7 @@ click(type, access_name) end - - - +When(/^I ta eeg on element having (.+) "(.*?)"$/) do |type, access_name| + validate_locator type + click(type, access_name) +end \ No newline at end of file