You can find the working project Here.
First we are going to create some example tests.
I'll be using selenium with python(pytest).
So for this example ill be creating 2 files one will be called conftest.py and the second one will be test_web01.py
import pytest
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.utils import ChromeType
from selenium import webdriver
@pytest.fixture()
def setup(request):
chrome_service = Service(ChromeDriverManager(chrome_type=ChromeType.GOOGLE).install())
chrome_options = Options()
options = [
"--headless",
"--disable-gpu",
"--window-size=1920,1200",
"--ignore-certificate-errors",
"--disable-extensions",
"--no-sandbox",
"--disable-dev-shm-usage"
]
for option in options:
chrome_options.add_argument(option)
request.cls.driver = webdriver.Chrome(service=chrome_service, options=chrome_options)
yield request.cls.driver
request.cls.driver.close()
Now lets create the second file where the actual tests are.
import pytest
@pytest.mark.usefixtures("setup")
class TestExampleOne:
def test_title(self):
self.driver.get('https://www.delrayo.tech')
assert self.driver.title == "DelRayo.tech - Delrayo Tech"
def test_title_blog(self):
self.driver.get('https://www.delrayo.tech/blog')
print(self.driver.title)
For running with GithubActions we have to create the following file structure on the repo.
- -.github
- --workflows
- ---test01.yaml
# .github/workflows/test01.yaml
name: test01
on:
workflow_dispatch:
jobs:
test01:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
#Setup Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install software
run: sudo apt-get install -y chromium-browser
- name: Install the necessary packages
run: pip install requests webdriver-manager selenium pytest
- name: Run the PytTest script
run: pytest -rA
Now we just have to go to the actions section on github, select the workflow named test01 and click on the button run workflow.
You can configure this workflow to execute on different triggers modifying
on:
workflow_dispatch:
With any of these options.
You can find the working project Here.
Top comments (2)
I was in Cambridge, looking at the colleges. It started to rain heavily. Ducked into a doorway on King's Parade. Tried chickenroad to wait out the shower. Played a simple arcade game. I won five times in a row. I couldn't lose. The rain stopped, and I walked away with a heavier wallet. Bought a book at a local shop with the profits. Intellectual city, smart betting, and a great way to dodge the British rain.
Ik was onlangs op zoek naar nieuwe pokeruitdagingen en vond winaura via een zoekopdracht op internet. De site trok me aan door de professionele uitstraling en de duidelijke interface. Ik had die dag niet veel verwacht, maar won onverwacht een groot toernooi. Het was een geweldige ervaring die me een flink bedrag opleverde. Het is een fijne plek om te spelen zonder onnodige afleidingen. Ik raad het iedereen aan die serieus met poker bezig wil zijn in ons land.