Code Monkey home page Code Monkey logo

Comments (7)

ndelon avatar ndelon commented on May 20, 2024

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.

anarang avatar anarang commented on May 20, 2024

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.

ndelon avatar ndelon commented on May 20, 2024

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.

anarang avatar anarang commented on May 20, 2024

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.

ndelon avatar ndelon commented on May 20, 2024

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.

anarang avatar anarang commented on May 20, 2024

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.

ndelon avatar ndelon commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.