Skip to content

Commit

Permalink
Merge pull request #2166 from zebrunner/#2164-2
Browse files Browse the repository at this point in the history
register owner launch attribute
  • Loading branch information
akamarouski authored Apr 5, 2023
2 parents ea90190 + 98dcff3 commit 24ba123
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ public void onStart(ISuite suite) {
if (!sha1.isEmpty()) {
Label.attachToTestRun("sha1", sha1);
}

// register owner of the run
registerOwner();

/*
* To support multi-suite declaration as below we have to init test run labels at once only!
Expand Down Expand Up @@ -863,6 +866,26 @@ private void attachTestRunLabels(ISuite suite) {
Label.attachToTestRun(SpecialKeywords.QTEST_PROJECT_ID, qtestProject);
}
}

/**
* Register owner launch attribute<br>
* -DBUILD_USER_ID="develop"<br>
* 1. read from system properties BUILD_USER_ID<br>
* 2. if it is not empty -> register as owner label for run/launch<br>
* 3. if it is empty -> read env var USERNAME<br>
* 4. if not empty -> register as owner<br>
* 5.Label.attachToTestRun("Author", "Andrei Kamarouski");<br>
*/
private void registerOwner() {
String owner = System.getProperty("BUILD_USER_ID");
if (owner == null) {
owner = System.getenv("USERNAME");
System.out.println(owner);
}
if (owner != null) {
Label.attachToTestRun("Owner", owner);
}
}

/*
* Capture screenshots for all available drivers after test fail/skip.
Expand Down

0 comments on commit 24ba123

Please sign in to comment.