Giter Club home page Giter Club logo

Comments (6)

mvysny avatar mvysny commented on August 21, 2024 1

Hi, I'm sorry, I only listed examples in Kotlin and I omitted examples in Java. I've updated the page at https://github.com/mvysny/karibu-testing/tree/master/karibu-testing-v8 with Java examples, could you please take a look whether the examples work for you?

from karibu-testing.

Illidanek avatar Illidanek commented on August 21, 2024 1

Brilliant! That works.
You are a saviour.

from karibu-testing.

Illidanek avatar Illidanek commented on August 21, 2024

Thanks! I have been able to add the cookie, but now I need the first VaadinRequest that comes into MyUI to have that cookie.
Or maybe otherwise, how do I initiate a mock call to my UI after I set the cookie?

from karibu-testing.

mvysny avatar mvysny commented on August 21, 2024

Right... The mocked request is created in MockVaadin.setup(); VaadinRequest.getCurrent() will return null before MockVaadin.setup() is called so that's not an option.

The only way I can see is to set the cookie in the UI creation closure passed into MockVaadin.setup(), something like this:

MockVaadin.setup(() -> {
  MockVaadinKt.getMock(VaadinRequest.getCurrent()).addCookie(new Cookie("foo", "bar"));
  return beanFactory.getBean(MyUI.class));
});

Let me test this, and if it works, I'll document this possibility.

from karibu-testing.

mvysny avatar mvysny commented on August 21, 2024

Yup, it works, I've updated the documentation at https://github.com/mvysny/karibu-testing/tree/master/karibu-testing-v8 - could you please check it out whether the documentation is clear?

from karibu-testing.

mvysny avatar mvysny commented on August 21, 2024

No problem, have a nice day 👋

from karibu-testing.

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.