summaryrefslogtreecommitdiff
path: root/vendor/github.com/playwright-community/playwright-go/page_assertions.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-12 16:33:27 -0600
committermo khan <mo@mokhan.ca>2025-05-12 16:33:27 -0600
commit29b59441a4bbada64d8d07bd2609f15dfde670e5 (patch)
tree3b3583edb261279cfcdfd9eed904d118c4bf67b1 /vendor/github.com/playwright-community/playwright-go/page_assertions.go
parent78ccd9a4312eab7e11da4413733a12953f88a4fe (diff)
test: remove UI tests
Diffstat (limited to 'vendor/github.com/playwright-community/playwright-go/page_assertions.go')
-rw-r--r--vendor/github.com/playwright-community/playwright-go/page_assertions.go70
1 files changed, 0 insertions, 70 deletions
diff --git a/vendor/github.com/playwright-community/playwright-go/page_assertions.go b/vendor/github.com/playwright-community/playwright-go/page_assertions.go
deleted file mode 100644
index 43bd0dc..0000000
--- a/vendor/github.com/playwright-community/playwright-go/page_assertions.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package playwright
-
-import (
- "net/url"
- "path"
-)
-
-type pageAssertionsImpl struct {
- assertionsBase
- actualPage Page
-}
-
-func newPageAssertions(page Page, isNot bool, defaultTimeout *float64) *pageAssertionsImpl {
- return &pageAssertionsImpl{
- assertionsBase: assertionsBase{
- actualLocator: page.Locator(":root"),
- isNot: isNot,
- defaultTimeout: defaultTimeout,
- },
- actualPage: page,
- }
-}
-
-func (pa *pageAssertionsImpl) ToHaveTitle(titleOrRegExp interface{}, options ...PageAssertionsToHaveTitleOptions) error {
- var timeout *float64
- if len(options) == 1 {
- timeout = options[0].Timeout
- }
- expectedValues, err := toExpectedTextValues([]interface{}{titleOrRegExp}, false, true, nil)
- if err != nil {
- return err
- }
- return pa.expect(
- "to.have.title",
- frameExpectOptions{ExpectedText: expectedValues, Timeout: timeout},
- titleOrRegExp,
- "Page title expected to be",
- )
-}
-
-func (pa *pageAssertionsImpl) ToHaveURL(urlOrRegExp interface{}, options ...PageAssertionsToHaveURLOptions) error {
- var timeout *float64
- var ignoreCase *bool
- if len(options) == 1 {
- timeout = options[0].Timeout
- ignoreCase = options[0].IgnoreCase
- }
-
- baseURL := pa.actualPage.Context().(*browserContextImpl).options.BaseURL
- if urlPath, ok := urlOrRegExp.(string); ok && baseURL != nil {
- u, _ := url.Parse(*baseURL)
- u.Path = path.Join(u.Path, urlPath)
- urlOrRegExp = u.String()
- }
-
- expectedValues, err := toExpectedTextValues([]interface{}{urlOrRegExp}, false, false, ignoreCase)
- if err != nil {
- return err
- }
- return pa.expect(
- "to.have.url",
- frameExpectOptions{ExpectedText: expectedValues, Timeout: timeout},
- urlOrRegExp,
- "Page URL expected to be",
- )
-}
-
-func (pa *pageAssertionsImpl) Not() PageAssertions {
- return newPageAssertions(pa.actualPage, true, pa.defaultTimeout)
-}