GitHub: /SeldomQA/auto-wing
Background: We have introduced AI automation testing auxiliary tools before. I personally recognize it. However, because it is implemented based on TS language, more software test engineers use Python language! Let me use Python to implement a need to meet more test engineers.
Auto-Wing's positioning
Since the thinking of drawing on, why not be called Midsencepy? Because I want to create the AI automation auxiliary tools and some differences.
- He should be able to easily apply to existing automation projects. After all, we have written a lot of automation projects, which is the best access to AI.
- He should support more domestic LLM. The domestic LLM is not weak, okay! These two days are not being quilt
deepseek-v3
Swipe the screen. Convenient and cheap, right? Intersection - He should support
playwright
andselenium
; Most tools are based onplaywright
, Howeverselenium
Seems to be abandoned, I'll give itselenium
Last ventilator.
I'm glad, I came out at home while I was in my New Year. I did thatTest engineer
The group thinks, github adds a puppet!
Why is it called Auto-Wing? Of course, it is to insert your AI wings and take off in place directly, haha!
characteristic
⭐ Support multiple operations:ai_action
、ai_query
、ai_assert
。
⭐ Support multi -model:openai
、qwen
anddeepseek
。
Supportplaywright
、selenium
。
automatic Convenient and existing automation projects (pytest
、unittest
)integrated.
Install
pip install autowing
Set environment variable
Method one
Apply for the key needed by LLM, and create in the root directory of the project.env
document. recommenddeepseek
The first is cheap and powerful (yes, I am dying deepseek).
- DeepSeek: /
#.env
AUTOWING_MODEL_PROVIDER=deepseek
DEEPSEEK_API_KEY=sk-abdefghijklmnopqrstwvwxyz0123456789
Method two
If you don't want to use Python-Dotenv to configure environment variables, you can directly configure environment variables.
export AUTOWING_MODEL_PROVIDER=deepseek
export DEEPSEEK_API_KEY=sk-abdefghijklmnopqrstwvwxyz0123456789
Example
Note:pytest
、unittest
andplaywright
、selenium
You can combine two or two.
- Pytest + Playwright Example
"" "
Pytest Example for Playwright with AI Automation.
"" "
Import pytest
From Playwright.sync_api Import Page, Sync_playwright
From Import Create_fixTure
From Dotenv Import Load_dotenv
@(scope = "session")
DEF PAGE ():
"" "
Playwright FIXTUR
"" "
# loading .env file
load_dotenv ()
With sync_playwright () as P:
browser = (headless = false)
context = browser.new_context ()
pay = context.new_page ()
YIELD PAGE
()
()
@ @
DEF AI (Page):
"" "
ai FIXTURE
"" "
ai_fixTure = Create_fixTure ()
Return aI_FIXTURE (PAGE)
def test_bing_search (page: page, ai):
"" "
Test Bing Search Functionality USING AI-Driven Automation.
This test demodrates:
1. Navigating to Bing
2. Performing a search
3. Verifying Search Results
"" "
("")
ai.ai_ACTION ('Search input box input "Playwright" keywords, and Enter the car)
Page.wait_For_Timeout (3000)
items = ai.ai_query ('String [], the search results list contains "Playwright" related titles')
Print ("query", items)
Assert len (items)> 1
Print ("Assert")
Assert ai.ai_assert ('Check the search results list Article 1 title contains "Playwright" string')
- Unittest + Selenium Example
"" "
Unittest Example for Selenium with AI AUTOMATION.
"" "
Import Unittest
Import time
From SELENIUM Import Webdriver
From Import Create_fixTure
From Dotenv Import Load_dotenv
class testbingsearch ():
@classmedhod
DEF SETUPCLASS (CLS):
# load .env file
load_dotenv ()
# Initialize edge webdriver
= ()
# Create ai fixture
ai_fixTure = Create_fixTure ()
= AI_FIXTURE ()
@classmedhod
DEF TeardownClass (CLS):
()
def test_01_bing_search (seld):
"" "
Test Bing Search Functionality USING AI-Driven Automation.
This test demodrates:
1. Navigating to Bing
2. Performing a search
3. Verifying Search Results
"" "
("")
.Ai_ACTION ('Search input box input "Playwright" keywords and return to the car)
(3)
items = .ai_query ('String [], the search results list contains "Playwright" related titles')
Print ("query", items)
(Len (Items), 1)
((
.Ai_ASSERT ('Check the search results list Article 1 title contains "Playwright" string')
Cure
if __Name__ == '__main__':
()
Q/A
- Does the app support? Planning support.
-
auto-wing
Just released, there must be a lot of pit. The project has been promoted to the project update, and you can only send a comment silently. -
auto-wing
After stability,seldom
andlounger
The project will also be integrated simultaneously. - Finally, bless everyone: Happy New Year ~! Essence