question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automated testing example

See original GitHub issue

Hello,

Would it be possible to have an example on how to tests the queries and mutations using this library ? At the moment, I haven’t managed to test properly those because the @login_required is enabled and graphene cannot execute the requested queries on the schema. If you have an example of middleware to be used for the tests or any solutions I would be very interested.

Thanks in advance,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
coler-jcommented, Jan 17, 2021

@mongkok it returns a graphql.execution.base.ExecutionResult how can we get the json data from that?

Edit:

You can do:

response = self.client.execute(query, variables={})
response.to_dict()
1reaction
guilhermewebdevcommented, May 1, 2020

Hello @mongkok , I’m tring implemens this, but how i can use asserts? because the self.client.execute function returns a object, and I need to compare it whith a dict, how in graphene tests

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Automation Testing? Test Tutorial - Guru99
Automation Testing is a software testing technique that performs using special automated testing software tools to execute a test case suite. On ...
Read more >
Automation Testing Tutorial: A Starter's Guide With Example
Let us now see a basic test automation example. In this case, we will automate a web page making use of the Selenium...
Read more >
What are examples of automated testing? - Inflectra Corporation
What are examples of automated testing? · Hardware Testing · Software Testing · Performance Testing · Security Testing · Compatibility Testing · Spira ......
Read more >
What Are Automation Testing Tools? 9 Types & Examples
1. testRigor — Best overall no-code test automation for scalability and end-to-end tests · 2. Avo Assure — Best for no-code test automation...
Read more >
What are examples of automated testing? - Quora
UI automation using tools like selenium web driver, protractor, Cypres, · API automation using tools like Postman, soapUI.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found