-
Notifications
You must be signed in to change notification settings - Fork 10
Pat/Finished TR exercise #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os, logging | ||
import modules.testrail_integration as tri | ||
|
||
SUITES = ["Form Autofill", "Geolocation", "Language Packs"] | ||
FULL_COVERAGE_VALUE = 3 | ||
|
||
|
||
def main(): | ||
# Set env variables for testrail_init function | ||
os.environ["TESTRAIL_BASE_URL"] = "https://mozilla.testrail.io" | ||
os.environ["TESTRAIL_USERNAME"] = "user" | ||
os.environ["TESTRAIL_API_KEY"] = "api_key" | ||
tr = tri.testrail_init() | ||
|
||
# Get all suites from our project | ||
for suite in tr.get_suites(17): | ||
if suite["name"] not in SUITES: | ||
continue | ||
# Loop through all the test cases in the target suite | ||
for case in tr._get_test_cases(17, suite["id"])["cases"]: | ||
# Check if the custom automated field is set to see if we automated it | ||
if case["custom_automated_test_names"]: | ||
logging.info(f"Updating test case {case['id']} coverage status for full") | ||
tr.update_case_field(case['id'], "custom_automation_coverage", FULL_COVERAGE_VALUE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment this out and write a line that prints all the case numbers you would be updating, if it looks good I'll give the go-ahead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good, run the script! |
||
|
||
|
||
if __name__ == "__main__": | ||
main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that this is exactly how we want to check whether a case has been automated, but it might work? If you comment out the updater line below and print which cases this would update, what do you get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would get all the test cases, so a big big chunk of tests