Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ansuman92
    @Ansuman92
    image.png
    Erwin Heitzman
    @erwinheitzman
    @Ansuman92 sorry for the late reply but it looks like you are running the service on the same port as the selenium-standalone server which won't work so if that is the issue then choosing a different port will fix any issues you have
    10 replies
    I suggest using 8080 which is the default
    Ansuman92
    @Ansuman92
    image.png
    Ansuman92
    @Ansuman92
    image.png
    Erwin Heitzman
    @erwinheitzman
    @Ansuman92 the latest version of WebdriverIO has mocking/stubbing built-in, I think it makes more sense to use that as this service was created before mocking/stubbing was available in WebdriverIO
    Ansuman92
    @Ansuman92
    @erwinheitzman - Ah okay..I'm using WebdriverIO V6 with Cucumber framework only.
    Just to avoid any confusion, So you mean we need to have only services: ['wiremock'] in our config file and the above folder __files (to use fixture files) and mappings (Where we provide the endpoint, HTTP Method, RQ and RS) should be created that's it in order to mock/stub backend api in WDIO framework V6?
    Erwin Heitzman
    @erwinheitzman
    @Ansuman92 no what I am saying is that this service is created separately from WebdriverIO and that by now, v6 has a built-in way to do this. Let me search the docs
    It's completely new and allows for better future support
    Not that I do not want you to use my service, because I am very happy that I could help a lot of people with this service but since there's a better alternative by now I do want to steer people in the right direction :)
    This service is browser independent, that's a nice bonus though ^^
    Ansuman92
    @Ansuman92
    Thanks @erwinheitzman for sharing your valuable inputs :)
    I'll go through the above docs and try to implement that in my V6 framework
    Erwin Heitzman
    @erwinheitzman
    @Ansuman92 you are welcome, good luck on your journey!
    Ansuman92
    @Ansuman92
    @erwinheitzman - Just one last thing before I start doing POC on this, The below one is the right docs to go through if I have to start from the scratch right?
    image.png
    Erwin Heitzman
    @erwinheitzman
    It's a blog so things might have slightly changed by now
    @Ansuman92 I'd use it with this https://webdriver.io/docs/mocksandspies.html
    that's the official documentation about it
    Ansuman92
    @Ansuman92
    cool
    Thanks a lot @erwinheitzman!
    Ansuman92
    @Ansuman92
    @erwinheitzman - Sorry to trouble you again but by any chance do you have any idea where to create a mock as shown below?
    image.png
    Erwin Heitzman
    @erwinheitzman
    you can create it anywhere you want
    just make sure it's triggered at the right moment
    to understand that you need a bit of programming / javascript knowledge
    the easiest way is to keep it all in the spec file
    I haven't used this functionality myself yet so you might also be able to define the mocks gloablly
    But I'm not sure about that
    Should be really easy to get the example working though
    Ansuman92
    @Ansuman92
    Thanks @erwinheitzman , Actually the only concern here is whether do I need to have the step written in the feature file for this mocking part and accordingly need to define the implementation in the step definition.
    And also at what stage do I have to call this as it doesn't mentioned anything in the given docs.
    Erwin Heitzman
    @erwinheitzman
    This would be part of your steps or your hooks maybe
    Webdriverio is a gitter channel which is perfect for support questions about this as well
    Ansuman92
    @Ansuman92
    Actually placing in hooks step would not help I guess as there might be change in the API request for multiple scenarios.
    Sure, I'll post it over there.
    Thanks @erwinheitzman for clarifying almost each and every queries in detailed way:)
    Erwin Heitzman
    @erwinheitzman
    Again you are welcome, feel free to ask me personally in a pm as well if you're stuck
    Ansuman92
    @Ansuman92
    Sure @erwinheitzman .
    Alona
    @Alona-T
    Hello @erwinheitzman
    I read the whole thread but still did not find the answer
    i want to use this service for our native apps but i am not sure if it is possible
    Our app is API based - using API to reflect info on mobile app itself so it is crucial to have mocked data
    On webdriverio docs i read it is applicable for chrome and some more and nothing about mobile but some people are saying is possible
    So wonder is it?
    Erwin Heitzman
    @erwinheitzman
    @Alona-T I haven't tested this with mobile but the thing about WireMock is that it is framework independent. It allows you to mock any API on your localhost for any browser :)
    Also this kind of mocking with WireMock is not the same as the current built-in mocking that WebdriverIO now has by default which uses the De tools API. Which is why only Chromium (Chrome and Edge) and Firefox support it right now
    Hope this helps! If this brings up any questions, feel free to ask
    ahmed mohammed
    @ahmedmdm_twitter
    Hi, I am planning to use wiremock service for proxying. Everything works but its continuing to forward the call to actual services as well. Is there a setting we need to disable or provide in wdio options?
    Erwin Heitzman
    @erwinheitzman
    @ahmedmdm_twitter all the options that WireMock supports can be set by passing arguments
    For all the supported options I would refer you to the official WireMock documentation
    I'll update the docs soon to reflect that a bit better