Code Monkey home page Code Monkey logo

playwright-test's People

Contributors

tomoyachen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

playwright-test's Issues

Playwright 录制视频需要关闭 page,导致测试类中失败了一条用例后,浏览器关闭了,而后面还有其他用例。

通常为了在一个测试类里面执行多条测试用例,并且共用一个浏览器页面,我会定义 page 为 class 作用域。
但是 Playwright 录制视频需要 page.context.close()
这就导致了 如果有一条用例失败后,后续的同一测试类中其他 function 也会因为 page 被提前关闭而执行失败。

@pytest.fixture(scope="class")
def page(browser: Browser):
    page:Page = browser.new_page(record_video_dir='./videos')
    yield page
    page.close()

安装依赖中命令行执行poetry报错解决

poetry install
有时报:
[Errno 13] Permission denied: '\Scripts\ucrtbase.dll
或这个错
PermissionError
[WinError 5] 拒绝访问。: 'd:\anaconda3\ucrtbase.dll' -> 'C:\Users\xxx\AppData\Local\pypoetry\Cache\virtualenvs\playwright-test-IPShjk7t-py3.8\Scripts\ucrtbase.dll'

使用python -m poetry install即可

如何保持登录

你好,请问下,
使用了
import pytest
from playwright.async_api import Page

写了一个登录方法,如何保持这个登录,进行后续测试呢?
不同.py文件

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.