cucumber test file download

后端 未结 5 1254
渐次进展
渐次进展 2020-12-10 02:32

Anybody have idea how to test file download using cucumber?

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 02:48

    On chrome I do it by opening the page: chrome://downloads and then use the shadow dom to retrieve the downloaded files:

    document
      .querySelector('downloads-manager')
      .shadowRoot.querySelector('#downloads-list')
      .getElementsByTagName('downloads-item');
    

    The downloaded files list also contain information such as file path and download date.

提交回复
热议问题