【问题标题】:Ruby/Capybara:-Can we Automate Omniture Test cases using Cucumber with Capybara&selenium?Ruby/Capybara:我们可以使用 Cucumber 和 Capybara&selenium 自动化 Omniture 测试用例吗?
【发布时间】:2013-01-28 12:35:44
【问题描述】:

我们可以使用 Cucumber 和 Capybara&selenium 自动化 Omniture 测试用例吗?如果可以,谁能告诉我步骤是什么。 很多天以来,我一直在努力自动化生成事件但不知道如何自动化的 Omniture 测试用例?

【问题讨论】:

  • 您到底想检查什么?在您的情况下,omniture tets 是什么?

标签: capybara


【解决方案1】:

您应该可以通过浏览器访问 javascript 变量。访问您的站点并打开控制台。输入 s.events 并查看值是什么。因此,假设您想在用户单击按钮后使用值填充 s.events,但您不想触发页面加载事件,只要您知道单击和页面加载事件的值应该是什么那么您的测试将如下所示:

Given I visit a page
When I click a button
Then I should see "this" and not "that"

Then /^I should see "(.*?)" and not "(.*?)"$/ do |good, bad|
   events = page.evaluate_script("s.events")
   events.should include(good), "expected events to include #{good} but saw #{events}"
   events.should not_include(bad), "did not expect to see #{bad} in events"

【讨论】:

    猜你喜欢
    • 2011-05-28
    • 2018-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-13
    相关资源
    最近更新 更多