我想用给定的格式编写手动测试,但是要在相关情况下以这种格式编写测试,并且想要寻求帮助。
这是测试的手动过程:
我不知道该如何以GIVEN,WHEN,THEN风格编写并保持简洁,因此请提供帮助。
我尝试过,但对此不满意:
Given user opens the homepage
And the user logs in
Then the logout button is displayed
Given user selects another tab
And user opens the homepage
And user logs in
Then the log out button is displayed
When I log out of homepage
Then the login panel is displayed
When I switch tabs
And I refresh the other homepage
Then the login panel is displayed
我对此不太满意,所以有人可以帮我吗?
答案 0 :(得分:1)
Given user opens the homepage
And the user logs in
Then user opens the Url(MainPage) in another tab
And then clicked on the logout button in one of the tab
And able to see the login panel in the same tab
Then User switched to other tab
And Refresh the Page or tab
Then User now able to see the login panel in other tab also.
注意: 给出,何时,然后 是关键字,我们正在使用它们编写方案,以便使代码更易读为业务。除了可读性之外,它们没有其他影响或功能。