Skip to content
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

SetUpClass() is not listening while running test suite. #9

Open
rvijai92 opened this issue Jan 14, 2019 · 5 comments
Open

SetUpClass() is not listening while running test suite. #9

rvijai92 opened this issue Jan 14, 2019 · 5 comments

Comments

@rvijai92
Copy link

Hi, I have done the setup for multiple test cases to run using pocotestsuite module but whenever executing runner file, only listening to the setUp() function, not listening the setUpClass(). Can you provide clear details on how to execute the multiple test cases simultaneously.

@adolli
Copy link
Member

adolli commented Jan 21, 2019

setUpClass will only be invoked once at the initialization stage of class TestSuite or TestCase. Here is an example of how to run cases together https://github.com/AirtestProject/my-testflow/blob/master/testflow/scripts/multitests_together.py . Please note that together means all testcases will be run without a guaranteed sequence. If u really want simultaneously, u have to connect multiple smart phones.

@adolli
Copy link
Member

adolli commented Jan 21, 2019

more differences about setUpClass and setUp. setUpClass of each TestCase or TestSuite invoke before running all testcases, while setUp is invoking just at the beginning of the TestSuite or TestCase.

a sequence flow looks like:

...setUpClass -> setUp1 -> tearDown1 -> setUp2 -> tearDown2 -> ...tearDownClass

@rvijai92
Copy link
Author

Thanks adolli, If there are 10 test cases, Will be able to write that 10 test cases in the 10 .py modules. So every time SetUp, setUpClass, tearDown and tearDownClass will it be invoked right for Every test run. In that scenario, Every time app will be closed and reopened often for each runTest().

Base Module: (.py)
SetUpClass:
SetUp:
TearDown:
TearDownClass:

TestCase1 module( Extends with Base):
runTest:

TestCase2 module( Extends with Base):
runTest:

TestCase3 module( Extends with Base):
runTest:

TestCase4 module( Extends with Module 1):
runTest:

Questions:

  1. Can I write runTest without having class in the different?
  2. Do I create a runner module for the suite run?
  3. Is that possible the continue scenarios will be integrating between 2 test cases?
  4. I have seen there are two 2 classes such as PocoTestSuite and PocoTestCase. To which class do I want to extend?

@adolli
Copy link
Member

adolli commented Mar 1, 2019

  1. u cannot write a testcase without a class or class-like structure. Unless u make your own execution sequence.
  2. Simply use pocounit.run(xxx) where xxx is your testcase or testsuite.
  3. I am not sure what do u mean by "the continue scenarios". Is that you cannot determine the next case to run until the current case is finished?
  4. PocoTestSuite is a container for PocoTestCase. 1 suite could have 1 or more suites/cases. Both of them have the same lifecycle stages. Cases in the suite are executed sequentially.

@adolli
Copy link
Member

adolli commented Mar 1, 2019

@rvijai92 sorry for the inconvenience and late reply, i am too busy all the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants