diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-31 16:09:12 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-31 16:09:12 -0600 |
| commit | 311603d0c0b04d451e9fb8e5e8335dca8425e2c4 (patch) | |
| tree | f38db8e10c4b55aef21c96c30fc71278c6e3d5c6 /vendor/github.com/playwright-community/playwright-go/page_assertions.go | |
| parent | ebb003ef2beaeee61104d6b88a342c5c9fa73b51 (diff) | |
Connect to postgresql
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.go | 70 |
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) -} |
