Cannot grab browser logs on failure with multiple workers - question

Đang mở
#2,818 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, nodejs
Lĩnh vực
testing-qa

Hướng nghiên cứu

Bắt đầu với lệnh run-workers, hook event.test.failed và tài liệu về thực thi song song tùy chỉnh được liên kết trong issue. So sánh cách quyền truy cập trình duyệt và các sự kiện lỗi hoạt động với run-workers so với run, sau đó xác minh rằng có thể thu thập log trình duyệt sau khi một bài kiểm thử thất bại khi sử dụng nhiều worker.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement
What are you trying to achieve?

I want to grab browser logs when some test failed, tests are run using command: ./node_modules/.bin/codeceptjs run-workers 2 --grep "@sometesttag" --plugins allure

And I see that custom hook:

event.dispatcher.on(event.test.failed, async (test, error) => { 

})

inside which I use await I.grabBrowserLogs(); is not working when we use multiple workers. (when we use run-workers command, with run this code works OK)

Tried also surround some part of the code with try / catch block and call await I.grabBrowserLogs(); on error, but it does not work either.

Is this possible to make it working, simply to grab logs from browser on test failure (i.e. some element is not clickable on the page, or it is not in DOM), when we are using multiple workers? FYI - with standard run command I am using custom hook and it works like a charm. And I would like to achieve something similar but when multiple workers are used. Is this possible? I believe it might be doable using https://codecept.io/parallel/#custom-parallel-execution but then, I assume that browser control must be customized as well, and then we simply won't be able to use built-in method on I actor, right?

Details
  • CodeceptJS version: 3.0.5
  • NodeJS Version: 12.20.2
  • Operating System: macOS Catalina
  • puppeteer
Ngôn ngữ chính
JavaScript
Star
4.2k
Fork
756
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
16

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codeceptjs/CodeceptJS

Tất cả issue của codeceptjs/CodeceptJS

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.