From dbb6e7291ebb8c09dc0460b7b45098bf112d1494 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 2 Dec 2023 12:44:21 +0300 Subject: [PATCH] enable unit test results for selenium --- .gitlab-ci.yml | 4 ++++ tests/integration/selenium_test.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a04b394f..8ab1a4991 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,6 +95,10 @@ selenium: - python3 tests/integration/selenium_test.py needs: - job: phpunit-integration + artifacts: + when: always + reports: + junit: selenium-report.xml ttrss-web-nginx:publish: stage: publish diff --git a/tests/integration/selenium_test.py b/tests/integration/selenium_test.py index 780f46265..f2d16fd73 100644 --- a/tests/integration/selenium_test.py +++ b/tests/integration/selenium_test.py @@ -2,6 +2,7 @@ import os import unittest +import xmlrunner from selenium import webdriver from selenium.webdriver.common.by import By @@ -67,4 +68,5 @@ class SeleniumTest(unittest.TestCase): assert self.driver.find_element(by=By.CSS_SELECTOR, value="#feedTree").is_displayed() -unittest.main() +with open('selenium-results.xml', 'wb') as output: + unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output))