Skip to main content

A simple and easy-to-use testing library for web and mobile applications

Project description

EasyTest

EasyTest is a Python library designed to simplify the process of writing automated tests for web and mobile applications. It provides a set of easy-to-use functions for common testing tasks such as finding elements, clicking elements, inputting text, and taking screenshots.

Whether you're testing a website with Selenium WebDriver or a mobile application with Appium, EasyTest can help you write your tests faster and with less code. It's compatible with both Selenium and Appium, making it a versatile tool for any tester's toolkit.

The library also integrates with Allure, a flexible and lightweight tool for generating test reports in multiple languages, to provide detailed and informative test reports. This makes understanding test results and debugging any issues that arise during testing easier.

With EasyTest, you can focus more on designing your tests rather than the low-level details of interacting with your application. It's a great way to make your testing process more efficient and effective.

EasyTest - это библиотека Python, разработанная для упрощения процесса написания автоматизированных тестов для веб- и мобильных приложений. Она предоставляет набор простых в использовании функций для общих задач тестирования, таких как поиск элементов, клик по элементам, ввод текста и создание скриншотов.

Будь то тестирование веб-сайта с помощью Selenium WebDriver или мобильного приложения с помощью Appium, EasyTest может помочь вам быстрее и с меньшим количеством кода написать ваши тесты. Она совместима как с Selenium, так и с Appium, что делает ее универсальным инструментом для любого набора инструментов тестировщика.

Библиотека также интегрируется с Allure, гибким и легким инструментом для создания тестовых отчетов на нескольких языках, чтобы предоставить подробные и информативные отчеты о тестировании. Это облегчает понимание результатов тестов и отладку любых проблем, возникающих во время тестирования.

С EasyTest вы можете сосредоточиться больше на проектировании ваших тестов, а не на низкоуровневых деталях взаимодействия с вашим приложением. Это отличный способ сделать ваш процесс тестирования более эффективным и эффективным.

Usage

Here's a simple example of how you can use EasyTest to write a test for a web application:

python

from easytest import click_element, input_text, find_element from selenium import webdriver

driver = webdriver.Firefox()

Find an element

element = find_element(driver, ("id", "myElement"))

Click an element

click_element(driver, ("id", "myButton"))

Input text

input_text(driver, ("id", "myInput"), "Hello, World!")

Functions

find_element(driver, locator) -> WebElement

This function is used to find an element on the page. It takes two arguments:

  • driver: The WebDriver instance.
  • locator: A tuple containing the method to locate the element and the value. The method can be one of the following: "id", "class_name", "xpath", "name", "css", "tag_name", "link_text", "partial_link_text".

This function returns a WebElement if the element is found, or None if it's not.

click_element(driver, locator, take_screenshot=True)

This function is used to click an element on the page. It takes three arguments:

  • driver: The WebDriver instance.
  • locator: A tuple containing the method to locate the element and the value.
  • take_screenshot (optional): A boolean indicating whether to take a screenshot before and after clicking the element. Default is True.

input_text(driver, locator, input_text, take_screenshot=True)

This function is used to input text into an element on the page. It takes four arguments:

  • driver: The WebDriver instance.
  • locator: A tuple containing the method to locate the element and the value.
  • input_text: The text to input into the element.
  • take_screenshot (optional): A boolean indicating whether to take a screenshot before and after inputting the text. Default is True.

scroll(driver, direction='up', duration=800, steps=1)

This function is used to scroll the page. It takes four arguments:

  • driver: The WebDriver instance.
  • direction (optional): The direction to scroll. Can be "up", "down", "left", or "right". Default is "up".
  • duration (optional): The duration of the scroll in milliseconds. Default is 800.
  • steps (optional): The number of times to perform the scroll. Default is 1.

take_screen(driver, test_name)

This function is used to take a screenshot of the page. It takes two arguments:

  • driver: The WebDriver instance.
  • test_name: The name of the test. This is used to name the screenshot file.

Example

from easytest import find_element, click_element, input_text, scroll, take_screen

# Create a WebDriver instance
driver = ...

# Use the functions from easytest
element = find_element(driver, ("id", "my-element"))
click_element(driver, ("id", "my-button"))
input_text(driver, ("id", "my-input"), "Hello, world!")
scroll(driver, direction='down')
take_screen(driver, "my_test")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easytester-0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easytester-0.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file easytester-0.2.tar.gz.

File metadata

  • Download URL: easytester-0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.10.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.6

File hashes

Hashes for easytester-0.2.tar.gz
Algorithm Hash digest
SHA256 1fff27868e533a70a5edb0fee418022b6b162b6bb447f7718fcf4143edb9aa8d
MD5 98c7a6c750e5fbe6023f42df1ef47e48
BLAKE2b-256 bdbbb5969f6147b308ea6a5544d7d378ddea65da5d907812fccad9b6e55693b0

See more details on using hashes here.

File details

Details for the file easytester-0.2-py3-none-any.whl.

File metadata

  • Download URL: easytester-0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.10.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.6

File hashes

Hashes for easytester-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f5e9295ed7c8fb2dc64f6b0e232510dbbf03eaaf67ad49ac7bdae3775b436653
MD5 ef4befb52359aa687d6cef1a8420db46
BLAKE2b-256 678ca4d8a07ccc8cf92323bd4c1b0d92a106261d03e93290782b45f445400ce3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page