Comments (5)
@DLumi Not sure about the button by index suggestion, what's the use case? How is the index important? :)
Well, just as I told you: you can search buttons by name and get their index to call them later. Cause if the button is called directly by index, then if you, say, put another button just before the one you test (and this happens) - then the whole test would be failed because of that.
Moreover, personally, I don't see why you need to search the button and get all its data back in the first place.
Other than that, this library is the bomb. It really helps with a lot of testing that I previously had to do manually. Thanks!
from tgintegration.
Found a workaround. Just use Pyrogram's Client() functions to send a message.
The code should be like this:
async with controller.collect(count=1) as response:
await client.send_message(bot_id, text='Test text')
But it's kinda counterintuitive. Just saying.
from tgintegration.
On an unrelated note, it'd be cool to have a method that looks for the inline button and returns the button's index. Thus I won't have to change all the tests that refer to a specific button by index.
I'm sure I'd be able to do all of this by hand, but that would be a cool quality of life change.
from tgintegration.
@DLumi This makes me rethink whether the BotController
should just have generated methods for everything a regular Client
can do after all! 🤔
from tgintegration.
@DLumi Not sure about the button by index suggestion, what's the use case? How is the index important? :)
from tgintegration.
Related Issues (20)
- can not install tgintegration latest version 0.4.0 with pip HOT 2
- Examples for unittest module
- No type inference for Response type in collector when using PyCharm HOT 1
- Visual TestRunner UI inside Telegram
- Allow adding Pyrogram handlers during execution of a Pyrogram callback
- Locks for concurrent builds in CI/CD (GitHub Actions) HOT 3
- Containers should only work with Clients, not Controllers
- Pressing the first keyboard button is not possible HOT 2
- _raise=False failure to catch TimeoutError on python 3.7 HOT 2
- TgIntegration does not work when using asyncio.run()
- Import Error HOT 1
- Consider using tdlight User API
- Expose media captions in Response objects (as .full_text) HOT 1
- [Security] Workflow build.yml is using vulnerable action pre-commit/action
- Pyrogram==2.0.106 not supported
- Is package maintained?
- Feature request: send message in groupchat HOT 7
- Pyrogram.api.error doesn't exist HOT 3
- keywords mismatch HOT 2
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 tgintegration.