[Fixed]-Django pytest-selenium functional tests

1👍

You should configure self.browser inside setUp function. You are also missing an import for Keys. Code should be like this.

import pytest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from django.contrib.auth.models import Group, Permission, User
from django.test import TestCase, RequestFactory

class CreaPageTest(TestCase):
  def setUp(self):
        self.factory = RequestFactory()
        self.browser = webdriver.Firefox()

Also please refer to the docs, here http://selenium-python.readthedocs.org/getting-started.html

Leave a comment