GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — smartui-python-sample/test.py at main · keys-github/smartui-python-sample

Expand file tree

/

test.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
49 lines (40 loc) · 1.66 KB
/

test.py

Copy path

File metadata and controls

49 lines (40 loc) · 1.66 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import unittest
import sys
from selenium import webdriver
import os
username = os.getenv("LT_USERNAME") # Replace the username
access_key = os.getenv("LT_ACCESS_KEY") # Replace the access key
class FirstSampleTest(unittest.TestCase):
# Generate capabilities from here: https://www.lambdatest.com/capabilities-generator/
# setUp runs before each test case and
def setUp(self):
desired_caps = {
"build": 'PyunitTest sample build', # Change your build name here
"name": 'Py-unittest', # Change your test name here
"browserName": 'Chrome',
"version": 'latest',
"platform": 'Windows 10',
# "resolution": '1024x768', # change the resolution
"network": 'true', # Enable or disable network logs
"smartUI.project": "Testing-Smart-UI"
# Build name for smartUI(optional)
# "smartUI.build" : "buildName"
}
self.driver = webdriver.Remote(
command_executor="https://{}:{}@hub.lambdatest.com/wd/hub".format(
username, access_key),
desired_capabilities={"LT:Options": desired_caps})
# tearDown runs after each test case
def tearDown(self):
self.driver.quit()
# """ You can write the test cases here """
def test_unit_user_should_able_to_add_item(self):
# try:
driver = self.driver
# Url
driver.get("https://lambdatest.com")
print("Taking screenshot")
driver.execute_script("smartui.takeScreenshot,{\"screenshotName\":\"sample-screenshot-1\"}")
print("screenshot taken successfully")
if __name__ == "__main__":
unittest.main()
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.