2
我正在爲電子商務網站開發一個自動化套件,該套件具有不同國家/地區的網站頁面。我已經爲網站的各種功能開發了全部最多100個測試用例。現在,我的要求是,以測試相同功能的所有不同的國家(區域設置。)如何運行不同地區的所有功能
例如,
Locale QA Production
US XXXqa.com XXX.com
UK uk-XXXqa.com XXX.co.uk
FR fr-XXXqa.com XXX.fr
AU au-XXXqa.com XXX.com.au
DE de-XXXqa.com XXX.de
CA ca-XXXqa.com XXX.ca
JP jp-XXXqa.com XXX.co.jp
CN cn-XXXqa.com XXX.cn
對於登錄測試,我寫這個修改,包括所有國家
Scenario Outline: Existing user can sign in
Given I am an existing user
And I go to the <Country> homepage
And I click the 'LOG IN' link
And I am presented with the Log In modal
When I enter my credentials and click the LOG IN button
Then I am logged in
Examples:
| country |
| US |
| AU |
| FR |
Given /^I go to the (\w+) homepage$/ do |country|
@country = country_url
end
它似乎正在測試,因爲它能夠導航到不同的國家&測試功能。但是,如果遵循這種方法,我將不得不修改1000多行代碼。是否有任何其他替代方案可以通過各個國家的&測試登錄功能?
你爲什麼不創建具有國家代碼的數組,然後,在測試中,當您要訪問的網頁,你可以從循環做第一個國家'直到最後一個國家和'訪問(「#{country-code} -XXXqa.com」) – fabersky