Comments (7)
Hello Anisha,
You have done a import lemoncheesecake as lcc
instead of import lemoncheesecake.api as lcc
, that's why you get this error.
Regards.
from lemoncheesecake.
Hi @ndelon, thanks a lot for the help, that worked. I have another question here:
So, if I have 10 different files inside suites/ with multiple tests each but I just want the above fixture to run only once as a setup step for all the suites or tests. How can I do that?
I am calling the fixture as a part of the setup_suite but then that also would run for every suite. How about executing a block of code once for all the tests which also might include opening the browser.
Can you please suggest.
Below is the simplest implementation so far:
`
import lemoncheesecake.api as lcc
class Driver(object):
def setup_suite(self, setup_test_repo):
lcc.log_info("Inside setup")
def teardown_suite(self):
lcc.log_info("inside teardown")
`
from lemoncheesecake.
If you already use the "pre_run" fixture scope, it already does what you want: the fixture will be evaluated only once, at test startup.
Regards.
from lemoncheesecake.
But I think the pre_run will run for every suite correct, or I should add sequencing and not call this fixture for all tests?
do we have anything similar to post_run, which we can run once after all the suites have finished executing?
from lemoncheesecake.
No, a fixture with scope "pre_run" will be evaluated only once, no matter it's used in 1 place or 10 places.
About your second question: yes, you can have something like "fixture teardown"; see http://docs.lemoncheesecake.io/en/latest/fixtures.html and look for "fixture teardown".
from lemoncheesecake.
Thanks @ndelon for the quick response, that helped. is it possible to reach out to you on google chat or email for a quicker response?
from lemoncheesecake.
Well.. due to work and timezone shift, this place remains the most pratical one (at least for me), and everyone could benefit from the questions and answers (as far as they are not too specific).
from lemoncheesecake.
Related Issues (20)
- check_that vs. assert_that HOT 1
- lcc run skips execution of tests inside a folder created within the suites directory HOT 5
- Is there a known way to implement 'capture a screenshot when a check fails or error occurs' with lcc and selenium webdriver. HOT 24
- Unable to view html reports when integrated with Jenkins HOT 2
- Is there a env variable that can fetch the name of the current test? HOT 4
- lcc run --exit-error-on-failure doesn't exit nonzero on failure in teardown_suite HOT 7
- setup_suite and teardown_suite still run when a suite is disabled HOT 3
- setup_test and teardown_test don't run when defined in outer class HOT 3
- rank=<int> doesn't seem to be working as expected, the test suites are not executing according to rank number. HOT 3
- common package HOT 3
- Unable to pass any parameters to teardown_suite HOT 3
- Getting "Connection pool is full, discarding connection: 127.0.0.1" error while running test cases on thread HOT 22
- error: "AttributeError: 'InjectedFixture' object has no attribute 'get'" HOT 19
- Is there any way to capture screenshot for fail test cases if my fixture is using scope as "session" and "per_thread=True"? HOT 12
- Having issue in Genrating xml, Junit Reports. Getting error `Unknown reporting backend`. HOT 2
- JUnit reporting not working with LCC HOT 2
- Allow wildcard in test dependencies HOT 7
- `lcc run` with reporting argument does not run tests HOT 4
- Getting issue while running lcc report --failed HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lemoncheesecake.