|
1 | 1 | {
|
| 2 | + "toHaveUrl": { |
| 3 | + "prefix": "wdtoHaveUrl", |
| 4 | + "body": "expect(browser).toHaveUrl(${1:expectedUrl})", |
| 5 | + "description": "Checks if browser is on a specific page" |
| 6 | + }, |
| 7 | + "toHaveUrlContaining": { |
| 8 | + "prefix": "wdtoHaveUrlContaining", |
| 9 | + "body": "expect(browser).toHaveUrlContaining(${1:expectedValue})", |
| 10 | + "description": "Checks if browser is on a page URL that contains a value" |
| 11 | + }, |
| 12 | + "toHaveTitle": { |
| 13 | + "prefix": "wdtoHaveTitle", |
| 14 | + "body": "expect(browser).toHaveTitle(${1:expectedTitle})", |
| 15 | + "description": "Checks if website has a specific title" |
| 16 | + }, |
| 17 | + "toHaveTitleContaining": { |
| 18 | + "prefix": "wdtoHaveTitleContaining", |
| 19 | + "body": "expect(browser).toHaveTitleContaining(${1:expectedValue})", |
| 20 | + "description": "Checks if website has a specific title that contains a value" |
| 21 | + }, |
| 22 | + "toBeDisplayed": { |
| 23 | + "prefix": "wdtoBeDisplayed", |
| 24 | + "body": "expect(${1:element}).toBeDisplayed()", |
| 25 | + "description": "Calls isDisplayed on given element" |
| 26 | + }, |
| 27 | + "toExist": { |
| 28 | + "prefix": "wdtoExist", |
| 29 | + "body": "expect(${1:element}).toExist()", |
| 30 | + "description": "Calls isExisting on given element" |
| 31 | + }, |
| 32 | + "toBePresent": { |
| 33 | + "prefix": "wdtoBePresent", |
| 34 | + "body": "expect(${1:element}).toBePresent()", |
| 35 | + "description": "Same as toExist" |
| 36 | + }, |
| 37 | + "toBeExisting": { |
| 38 | + "prefix": "wdtoBeExisting", |
| 39 | + "body": "expect(${1:element}).toBeExisting()", |
| 40 | + "description": "Same as toExist" |
| 41 | + }, |
| 42 | + "toBeFocused": { |
| 43 | + "prefix": "wdtoBeFocused", |
| 44 | + "body": "expect(${1:element}).toBeFocused()", |
| 45 | + "description": "Checks if element has focus. This assertion only works in a web context" |
| 46 | + }, |
| 47 | + "toHaveAttribute": { |
| 48 | + "prefix": "wdtoHaveAttribute", |
| 49 | + "body": "expect(${1:element}).toHaveAttribute(${2:attribute}, ${3:expectedValue})", |
| 50 | + "description": "Checks if an element has a certain attribute with a specific value" |
| 51 | + }, |
| 52 | + "toHaveAttr": { |
| 53 | + "prefix": "wdtoHaveAttr", |
| 54 | + "body": "expect(${1:element}).toHaveAttr(${2:attribute}, ${3:expectedValue})", |
| 55 | + "description": "Same as toHaveAttribute" |
| 56 | + }, |
| 57 | + "toHaveAttributeContaining": { |
| 58 | + "prefix": "wdtoHaveAttributeContaining", |
| 59 | + "body": "expect(${1:element}).toHaveAttributeContaining(${2:attribute}, ${3:expectedValue})", |
| 60 | + "description": "Checks if an element has a certain attribute that contains a value" |
| 61 | + }, |
| 62 | + "toHaveAttrContaining": { |
| 63 | + "prefix": "wdtoHaveAttrContaining", |
| 64 | + "body": "expect(${1:element}).toHaveAttrContaining(${2:attribute}, ${3:expectedValue})", |
| 65 | + "description": "Same as toHaveAttributeContaining" |
| 66 | + }, |
| 67 | + "toHaveElementClass": { |
| 68 | + "prefix": "wdtoHaveElementClass", |
| 69 | + "body": "expect(${1:element}).toHaveElementClass(${2:className}, { message: ${3:textOnError}, })", |
| 70 | + "description": "Checks if an element has a certain class name" |
| 71 | + }, |
| 72 | + "toHaveElementClassContaining": { |
| 73 | + "prefix": "wdtoHaveElementClassContaining", |
| 74 | + "body": "expect(${1:element}).toHaveElementClassContaining(${2:expectedValue})", |
| 75 | + "description": "Checks if an element has a certain class name that contains provided value" |
| 76 | + }, |
| 77 | + "toHaveElementProperty": { |
| 78 | + "prefix": "wdtoHaveElementProperty", |
| 79 | + "body": "expect(${1:element}).toHaveElementProperty(${2:property}, ${3:expectedValue})", |
| 80 | + "description": "Checks if an element has a certain property" |
| 81 | + }, |
| 82 | + "toHaveValue": { |
| 83 | + "prefix": "wdtoHaveValue", |
| 84 | + "body": "expect(${1:element}).toHaveValue(${2:expectedValue}, { ignoreCase: ${3:true} })", |
| 85 | + "description": "Checks if an input element has a certain value" |
| 86 | + }, |
| 87 | + "toHaveValueContaining": { |
| 88 | + "prefix": "wdtoHaveValueContaining", |
| 89 | + "body": "expect(${1:element}).toHaveValueContaining(${2:expectedValue})", |
| 90 | + "description": "Checks if an input element contains a certain value" |
| 91 | + }, |
| 92 | + "toBeClickable": { |
| 93 | + "prefix": "wdtoBeClickable", |
| 94 | + "body": "expect(${1:element}).toBeClickable()", |
| 95 | + "description": "Checks if an element can be clicked by calling isClickable on the element" |
| 96 | + }, |
| 97 | + "toBeDisabled": { |
| 98 | + "prefix": "wdtoBeDisabled", |
| 99 | + "body": "expect(${1:element}).toBeDisabled()", |
| 100 | + "description": "Checks if an element is disabled by calling isEnabled on the element" |
| 101 | + }, |
| 102 | + "toBeEnabled": { |
| 103 | + "prefix": "wdtoBeEnabled", |
| 104 | + "body": "expect(${1:element}).toBeEnabled()", |
| 105 | + "description": "Checks if an element is enabled by calling isEnabled on the element" |
| 106 | + }, |
| 107 | + "toBeSelected": { |
| 108 | + "prefix": "wdtoBeSelected", |
| 109 | + "body": "expect(${1:element}).toBeSelected()", |
| 110 | + "description": "Checks if an element is enabled by calling isSelected on the element" |
| 111 | + }, |
| 112 | + "toBeChecked": { |
| 113 | + "prefix": "wdtoBeChecked", |
| 114 | + "body": "expect(${1:element}).toBeChecked()", |
| 115 | + "description": "Same as toBeSelected" |
| 116 | + }, |
| 117 | + "toHaveHref": { |
| 118 | + "prefix": "wdtoHaveHref", |
| 119 | + "body": "expect(${1:element}).toHaveHref(${2:expectedValue})", |
| 120 | + "description": "Checks if link element has a specific link target" |
| 121 | + }, |
| 122 | + "toHaveLink": { |
| 123 | + "prefix": "wdtoHaveLink", |
| 124 | + "body": "expect(${1:element}).toHaveLink(${2:expectedValue})", |
| 125 | + "description": "Same as toHaveHref" |
| 126 | + }, |
| 127 | + "toHaveHrefContaining": { |
| 128 | + "prefix": "wdtoHaveHrefContaining", |
| 129 | + "body": "expect(${1:element}).toHaveHrefContaining(${2:expectedValue})", |
| 130 | + "description": "Checks if link element contains a specific link target" |
| 131 | + }, |
| 132 | + "toHaveLinkContaining": { |
| 133 | + "prefix": "wdtoHaveLinkContaining", |
| 134 | + "body": "expect(${1:element}).toHaveLinkContaining(${2:expectedValue})", |
| 135 | + "description": "Same as toHaveHrefContaining" |
| 136 | + }, |
| 137 | + "toHaveId": { |
| 138 | + "prefix": "wdtoHaveId", |
| 139 | + "body": "expect(${1:element}).toHaveId(${2:expectedId})", |
| 140 | + "description": "Checks if element has a specific id attribute" |
| 141 | + }, |
| 142 | + "toHaveText": { |
| 143 | + "prefix": "wdtoHaveText", |
| 144 | + "body": "expect(${1:element}).toHaveText(${2:expectedText})", |
| 145 | + "description": "Checks if element has a specific text. Can also be called with an array as parameter in the case where the element can have different texts" |
| 146 | + }, |
| 147 | + "toHaveTextContaining": { |
| 148 | + "prefix": "wdtoHaveTextContaining", |
| 149 | + "body": "expect(${1:element}).toHaveTextContaining(${2:expectedText})", |
| 150 | + "description": "Checks if element contains a specific text. Can also be called with an array as parameter in the case where the element can have different texts" |
| 151 | + }, |
| 152 | + "toBeDisplayedInViewport": { |
| 153 | + "prefix": "wdtoBeDisplayedInViewport", |
| 154 | + "body": "expect(${1:element}).toBeDisplayedInViewport()", |
| 155 | + "description": "Checks if an element is within the viewport by calling isDisplayedInViewport on the element" |
| 156 | + }, |
| 157 | + "toHaveChildren": { |
| 158 | + "prefix": "wdtoHaveChildren", |
| 159 | + "body": "expect(${1:element}).toHaveChildren(${2:optionalExpectedCount})", |
| 160 | + "description": "Checks amount of the fetched element's children by calling element.$('./*') command" |
| 161 | + }, |
| 162 | + "toBeElementsArrayOfSize": { |
| 163 | + "prefix": "wdtoBeElementsArrayOfSize", |
| 164 | + "body": "expect(${1:listItems}).toBeElementsArrayOfSize(${2:expectedCount})", |
| 165 | + "description": "Checks amount of fetched elements using $$ command" |
| 166 | + }, |
| 167 | + "toBeRequested": { |
| 168 | + "prefix": "wdtoBeRequested", |
| 169 | + "body": "expect(${1:mock}).toBeRequested()", |
| 170 | + "description": "Checks that mock was called" |
| 171 | + }, |
| 172 | + "toBeRequestedTimes": { |
| 173 | + "prefix": "wdtoBeRequestedTimes", |
| 174 | + "body": "expect(${1:mock}).toBeRequestedTimes(${2:expectedCount})", |
| 175 | + "description": "Checks that mock was called for the expected amount of times" |
| 176 | + }, |
| 177 | + "toBeRequestedWith": { |
| 178 | + "prefix": "wdtoBeRequestedWith", |
| 179 | + "body": "expect(${1:mock}).toBeRequestedWith({ ${2:expectedOptions} })", |
| 180 | + "description": "Checks that mock was called according to the expected options" |
| 181 | + }, |
2 | 182 | "newSession": {
|
3 | 183 | "prefix": "wdnewSession",
|
4 | 184 | "body": "browser.newSession(${1:capabilities})",
|
|
0 commit comments