Run all my tests back to back
So I've create several tests. There are all in separate sikuli folders and I've scripted it so it's generating a html reportat the end of the tests. I wanted to know if there is a way to run them back to back? right now I'm just running them individually.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Sikuli Edit question
- Assignee:
- No assignee Edit question
- Last query:
- 2021-01-28
- Last reply:
- 2021-01-29
RaiMan (raimund-hocke) said : | #1 |
something like that?
https:/
Ali Ahmed (ali13xii) said : | #2 |
Ok so would I do it like this:
exitValue = runScript(
if exitValue > 1:
print "there was a special case"
elif exitValue == 1:
print "there was an exception"
else:
print "ran with success"
exit(exitValue)
exitValue = runScript(
if exitValue > 1:
print "there was a special case"
elif exitValue == 1:
print "there was an exception"
else:
print "ran with success"
exit(exitValue)
its just printing "there was a special case", but only prints it once. How would I do it exactly, I would appreciate help on this.
Ali Ahmed (ali13xii) said : | #3 |
I tried using this but its only running the first one once and it doesn't execute second test
runScript(
runScript(
RaiMan (raimund-hocke) said : | #4 |
This works for me:
https:/
unzip somewhere and adjust baseFolder in main.py.
in comment #2 the exit(exitValue) (line 8) in any case ends the main script.
BTW: Recommendation: Never use filenames containing blanks or special characters, only characters, numbers, hyphen and underscore. (Viewing and Edit Trade.sikuli is bad)
Ali Ahmed (ali13xii) said : | #5 |
I tried that dropbox link but it didn't have any files in it. DO u have another link with code. I would like to see how u go it to work. I will make that adjustment to the sikuli folder names. I should just be able to rename the folder from windows explorer, that should be fine right?
RaiMan (raimund-hocke) said : | #6 |
Sorry, cleaned my DropBox ;-)
Will try to recover it tomorrow.
Ali Ahmed (ali13xii) said : | #7 |
Oh ok, I would really appreciate it.
RaiMan (raimund-hocke) said : | #8 |
Ali Ahmed (ali13xii) said : | #9 |
So I tried to do it using your code as reference and it only runs the first test. Here is what I have:
baseFolder = "C:\SikuliX"
s1 = "LinkTagToTrade
s2 = "AddDocumentToT
exVal = runScript(
print s1, exVal
exVal = runScript(
print s2, exVal
Ali Ahmed (ali13xii) said : | #10 |
Ok so I think its having issue because I'm using HtmlTest report for these tests. Here is code for LinkTagToTrade, would I need to change it to run it using Runscript?
import random
import shutil
import os
import utils
reload(utils)
import HTMLTestRunner
import unittest
class UITestCases(
def setUp(self):
def tearDown(self):
def test_1(self):
wait(30)
wait(1)
if finalCount=
assert True
else:
assert False
suite = unittest.
outfile = open("Link_
runner = HTMLTestRunner.
RaiMan (raimund-hocke) said : | #11 |
--- description = 'NEW').run(suite)
does not look good ???
Try to close the outfile.
Ali Ahmed (ali13xii) said : | #12 |
What do you mean by "close the outfile"
What adjustment would I need to make?
RaiMan (raimund-hocke) said : | #13 |
Sorry to say: this is plain Python knowledge, which is essential when building more complex things with SikuliX scripts.
outfile = open("Link_
...
outfile.close()
Can you help with this problem?
Provide an answer of your own, or ask Ali Ahmed for more information if necessary.