1

您如何使用 Cucumber 测试 Google +1?我尝试通过添加此处找到的代码来手动测试 google +1 按钮(我使用的是 html5 版本)

http://code.google.com/apis/+1button/

当我尝试它时它抛出了一个错误。我将 data-href 更改为“http://google.com”(令人惊讶的是 google.com 只有 87 个 +1。@_@ 并不奇怪,因为他们的主页上没有 +1 按钮,但我离题了)现在它可以工作了。所以问题是,你如何在本地机器上测试它?

虽然我可以知道按下 plus1 按钮会调用我的回调,但如何在黄瓜中测试我喜欢本地/不存在的页面?是否有用于此的测试 API?

这是我在黄瓜步骤中的意思的示例:

When I go to the album "Lamp Girl" page
And I Google +1 the album "Lamp Girl"
Then the album "Lamp Girl" should have 1 like
4

1 回答 1

0

你肯定只是在这里测试谷歌的代码吗?对此进行测试有什么意义?你怕什么会出错?

于 2011-09-07T12:00:08.913 回答