简体   繁体   中英

How can I make tests that combine Selenium and Django when the development server can't run recent browsers?

I am working with a Django application running on the host foo-dev:8000, which runs Red Hat Enterprise Linux Server 6.8. I have python-based Selenium tests that run on my Windows 10 workstation as foo-dev is unable to use recent Selenium-supported versions of Chrome or Firefox. I would like to use Django in my Selenium tests to verify the database impact of the Selenium interactions.

As an example, there is a page in the application that displays a form for registering a device. I want to write a test that uses Selenium to fill this form and register the device on the Django test database. Once added, I want to use Django to assert that the device was added. I would then like the device entry to be cleared from the test database. The browser that performs these interactions has to run on the Windows 10 workstation, not foo-dev.

What do I need to do to accomplish this? Is it possible to use django unit tests on a separate machine from the server that runs the app?

It seems like you need a continuous integration stage in your deployment flow. Normally I'd suggest circleci but since you need windows to run the tests you might want to take a look at azure services or just add a custom server and set the flow yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM