Skip to content

Commit 8eb960a

Browse files
committed
toHaveClipboardText e2e
1 parent c49fce8 commit 8eb960a

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

playgrounds/multi-remote-mocha/test/specs/wdio-matchers.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ describe('WebdriverIO Custom Matchers', () => {
6565
await expect(multiRemoteBrowser).not.toHaveLocalStorageItem('key', expect.anything(), { wait: 0 })
6666
})
6767
})
68+
69+
describe('toHaveClipboardText Matcher', () => {
70+
it('should verify clipboard text', async () => {
71+
await expect(multiRemoteBrowser.unstable_select('chrome')).toHaveClipboardText('')
72+
})
73+
})
6874
})
6975

7076
describe('Multi-Remote Elements Matchers', () => {
@@ -159,6 +165,7 @@ describe('WebdriverIO Custom Matchers', () => {
159165
await expect(h1.unstable_filter((el) => el.isExisting())).toBeDisplayed()
160166
})
161167
})
168+
162169
describe('$$', () => {
163170
it('should verify elements are displayed', async () => {
164171
const h1 = multiRemoteBrowser.$$('h1')

types/expect-webdriverio.d.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,23 @@ interface WdioBrowserMatchers<_R, ActualT>{
160160
/**
161161
* `WebdriverIO.Browser` -> `execute`
162162
*/
163-
toHaveClipboardText: FnWhenBrowser<ActualT, (clipboardText: string | RegExp | ExpectWebdriverIO.PartialMatcher<string>, options?: ExpectWebdriverIO.StringOptions) => Promise<void>>
163+
toHaveClipboardText: FnWhenBrowserOrMultiRemote<ActualT,
164+
/**
165+
* `WebdriverIO.Browser` -> `getClipboard`
166+
*/
167+
(
168+
clipboardText: MaybeOneOf<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
169+
options?: ExpectWebdriverIO.StringOptions
170+
) => Promise<void>,
171+
172+
/**
173+
* `WebdriverIO.MultiRemoteBrowser` -> `getClipboard`
174+
*/
175+
(
176+
clipboardText: MultiRemoteValuesOrOneOf<string | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything>,
177+
options?: ExpectWebdriverIO.StringOptions
178+
) => Promise<void>
179+
>
164180

165181
/**
166182
* `WebdriverIO.Browser` -> `execute`

0 commit comments

Comments
 (0)