You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
importunittestfromtesting.webimportwebtestclassBrowserTest(unittest.TestCase):defsetUp(self):self.driver=webtest.new_webdriver_session()deftearDown(self):try:self.driver.quit()finally:self.driver=None# Your tests hereif__name__=="__main__":unittest.main()
Example Go Test
import ("testing""github.com/tebeka/selenium""github.com/bazelbuild/rules_web_testing_go/webtest")funcTestWebApp(t*testing.T) {wd,err:=webtest.NewWebDriverSession(selenium.Capabilities{})iferr!=nil {t.Fatal(err) }// your test hereiferr:=wd.Quit();err!=nil {t.Logf("Error quitting webdriver: %v",err) }}
BUILD file
In your BUILD files, load the correct language specific build rule and create atest target using it: