Giter VIP home page Giter VIP logo

python-ecommerce-selenium-conf's Introduction

Example: Python E-commerce

Demo tests to serve as a starting point for the State Model Based Testing with Selenium workshop at SeleniumConf 2023 in Chicago.

The site under test is available on GitHub pages here.

Prerequisites

You will need to have Python3 installed for this workshop. More info on that here: https://www.python.org/

Setup

Download or clone this repository locally, then run the following commands:

Linux/MacOS:

$ cd python-ecommerce-selenium-conf
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt

Windows:

$ cd python-ecommerce-selenium-conf
$ python -m venv .venv
$ .venv/Scripts/activate.bat
$ pip install -r requirements.txt

Read more about venv here.

Geckodriver

Download geckodriver.

After you download and extract the executable, make sure you set the path to the geckodriver executable in the Path variable to make other programs aware of its location.

On Windows:

$ set PATH=%PATH%;C:\bin\geckodriver

On Linux/MacOS:

$ ln -s /path/to/geckodriver /usr/local/bin/geckodriver

Run Tests

To run the tests use:

pytest -s 

Prepare Setup for State Model Based Tools

We will be using AltWalker and GraphWalker to implement and run models that we create during the State Model Based Workshop.

For this you will need to:

  • Install Java
  • Install and configure GraphWalker CLI using these commands:

on Mac/Linux

wget https://github.com/GraphWalker/graphwalker-project/releases/download/4.3.2/graphwalker-cli-4.3.2.jar && \
mkdir -p ~/graphwalker && \
mv graphwalker-cli-4.3.2.jar ~/graphwalker/ && \
echo -e '#!/bin/bash\njava -jar ~/graphwalker/graphwalker-cli-4.3.2.jar "$@"' > ~/graphwalker/graphwalker-cli.sh && \
chmod +x ~/graphwalker/graphwalker-cli.sh && \
ln -s ~/graphwalker/graphwalker-cli.sh /usr/local/bin/gw

and on Windows:

setx PATH "%PATH%;C:\graphwalker" & :: Adds graphwalker to current user PATH
cd C:\
mkdir graphwalker
cd graphwalker
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = 'tls12'; Invoke-WebRequest -Uri 'https://github.com/GraphWalker/graphwalker-project/releases/download/4.3.2/graphwalker-cli-4.3.2.jar' -outfile 'graphwalker-cli-4.3.2.jar'" & :: Downloads graphwalker using powershell command Invoke-Request
@echo off
@echo @echo off> gw.bat
@echo java -jar C:\graphwalker\graphwalker-cli-4.3.2.jar %*>> gw.bat
@echo on

To check that you GraphWalker correctly configured, run the following command and check that you get the same version:

$ gw --version
org.graphwalker version: 4.3.2-408d9b4

org.graphwalker is open source software licensed under MIT license
The software (and it's source) can be downloaded from http://graphwalker.org
For a complete list of this package software dependencies, see http://graphwalker.org/archive/site/graphwalker-cli/dependencies.html

python-ecommerce-selenium-conf's People

Contributors

rucindrea avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.