How to write given, when, then 用于切换标签检查登录

How to write given, when, then for switching tabs to check login

我想以 given, when, then 格式编写手动测试,但我很难为相关场景以这种格式编写测试,想寻求帮助。

这是测试的手动过程:

我不知道如何用 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  

我对此不是很满意所以有人可以帮我解决这个问题吗?

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.

注意:Given, When, Then是关键字,我们用编写Scenarios,让代码对业务来说更具可读性。除了可读性之外,它们没有任何影响或功能。