Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtutorial.py
More file actions
Latest commit
32 lines (24 loc) · 868 Bytes
/
Copy pathtutorial.py
File metadata and controls
32 lines (24 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
importio
importpytest
importrequests
fromapplitools.imagesimportEyes, BatchInfo, logger
fromPILimportImage
logger.set_logger(logger.StdoutLogger())
@pytest.fixture(name="eyes", scope="function")
defeyes_setup():
"""
Basic Eyes setup. It'll abort test if wasn't closed properly.
"""
eyes=Eyes()
eyes.configure.batch=BatchInfo("Demo Batch - Images - Python")
yieldeyes
# If the test was aborted before eyes.close was called, ends the test as aborted.
eyes.abort()
deftest_tutorial(eyes):
# Start the session and set app name and test name.
eyes.open("Demo App - Images Python", "Smoke Test - Images Python")
image=Image.open(io.BytesIO(requests.get("https://i.ibb.co/bJgzfb3/applitools.png").content))
# Visual checkpoint #1.
eyes.check_image(image)
# End the test.
eyes.close(False)