-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·40 lines (37 loc) · 1.33 KB
/
run_tests.sh
File metadata and controls
executable file
·40 lines (37 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Run tests for Appium MCP server
echo "Running tests for Appium MCP server..."
# Check if a specific test file or test was specified
if [ $# -eq 0 ]; then
# No arguments, run all tests
echo "Running command: pytest"
python -m pytest
elif [ $# -eq 1 ] && [ "$1" == "--cov" ]; then
# Run with coverage
echo "Running command: pytest --cov=main tests/"
python -m pytest --cov=main tests/
elif [ $# -eq 1 ] && [ "$1" == "--help" ]; then
# Show help
echo "Usage: ./run_tests.sh [options] [test_file] [test_name]"
echo ""
echo "Options:"
echo " --cov Run tests with coverage"
echo " --help Show this help message"
echo ""
echo "Examples:"
echo " ./run_tests.sh # Run all tests"
echo " ./run_tests.sh --cov # Run all tests with coverage"
echo " ./run_tests.sh tests/test_main.py # Run tests in test_main.py"
echo " ./run_tests.sh tests/test_main.py::TestAppiumMCP::test_find_element_success # Run a specific test"
exit 0
else
# Run specific test file or test
echo "Running command: pytest $@"
python -m pytest "$@"
fi
# Check if tests passed
if [ $? -eq 0 ]; then
echo "All tests passed."
else
echo "Some tests failed."
fi