多個設備上的端到端測試應用程序流程


1

我們的應用程序流程從桌面開始。在後期階段,有些情況下該過程需要在觸摸設備上進行批准。用戶在桌面上的頁面上等待。如果用戶在觸摸設備上打開相同的頁面(相同的角度應用程序),則另一個頁面將打開,他/她需要接受或拒絕該流程。在平板電腦階段,用戶在桌面上進行了阻止,但是在接受(或拒絕)該流程後,流程將移至下一頁(或上一頁)。

我們想針對這些情況創建一些e2e測試。我以為我們可以打開chrome瀏覽器實例(正常,桌面模式),進入平板電腦階段,然後打開chrome instanse(與觸摸設備兼容),然後繼續在桌面上運行。有什麼辦法可以實現這樣的目標嗎?目前,我們將角度8與protactor一起使用,但是任何框架都可以。

謝謝!

1

Surprisingly there is no tool to support multi client scenarios and synchronization out of the box as far as I know (looking for a new startup idea ?).

The general architectural problem you are trying to solve is one test, running somewhere, while controlling and getting feedback from N clients. This means you'll need the following building blocks:

  • A central management system to orchestrate tests and resources. Queuing test jobs, assigning clients and a machine to execute the test itself, be the hub for communication and generate test results.

  • A machine to run the test on, physically this can be the same machine as the central management runs on or one of the clients, but that won't scale nicely.

  • A test client, it will run commands on a browser or mobile device (mobiles usually needs a PC to control them) and report the results back

  • Communication channels between the above

In one of my previous companies we've built just that, unfortunately it was an internal tool so I can't disclose the exact details, but you can get some ideas from King's technical blog- our solution used a similar general approach.

Note that you can simply use Selenium Grid, and at the test side make sure to have multiple, isolated, thread safe, copies of your connection object. Here's an article I have found describing it. You should remember though that you'll quickly run into limitations of this solution, for example how do you ensure that you get the requested N clients for the test ? How do you handle delays ? King's solution put's the controlling element close to the tested element while Selenium Grid requires different and longer.