bukazu-portal-react 3.3.3 → 3.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/build/index.css +1 -1
  2. package/build/portal.es.js +19931 -20259
  3. package/build/portal.umd.js +80 -82
  4. package/package.json +9 -7
  5. package/.env.development +0 -1
  6. package/.eslintrc +0 -25
  7. package/.github/dependabot.yml +0 -11
  8. package/.github/workflows/node.js.yml +0 -31
  9. package/.github/workflows/npm-publish.yml +0 -33
  10. package/.nvmrc +0 -1
  11. package/.prettierrc +0 -6
  12. package/.vscode/settings.json +0 -24
  13. package/CHANGELOG.MD +0 -93
  14. package/babel.config.json +0 -6
  15. package/calendar.html +0 -16
  16. package/coverage/clover.xml +0 -28
  17. package/coverage/coverage-final.json +0 -2
  18. package/coverage/lcov-report/base.css +0 -224
  19. package/coverage/lcov-report/block-navigation.js +0 -87
  20. package/coverage/lcov-report/favicon.png +0 -0
  21. package/coverage/lcov-report/helper.ts.html +0 -142
  22. package/coverage/lcov-report/index.html +0 -116
  23. package/coverage/lcov-report/prettify.css +0 -1
  24. package/coverage/lcov-report/prettify.js +0 -2
  25. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  26. package/coverage/lcov-report/sorter.js +0 -196
  27. package/coverage/lcov.info +0 -36
  28. package/cypress/e2e/.examples/actions.spec.js +0 -299
  29. package/cypress/e2e/.examples/aliasing.spec.js +0 -39
  30. package/cypress/e2e/.examples/assertions.spec.js +0 -177
  31. package/cypress/e2e/.examples/connectors.spec.js +0 -97
  32. package/cypress/e2e/.examples/cookies.spec.js +0 -77
  33. package/cypress/e2e/.examples/cypress_api.spec.js +0 -202
  34. package/cypress/e2e/.examples/files.spec.js +0 -89
  35. package/cypress/e2e/.examples/local_storage.spec.js +0 -52
  36. package/cypress/e2e/.examples/location.spec.js +0 -32
  37. package/cypress/e2e/.examples/misc.spec.js +0 -104
  38. package/cypress/e2e/.examples/navigation.spec.js +0 -56
  39. package/cypress/e2e/.examples/network_requests.spec.js +0 -163
  40. package/cypress/e2e/.examples/querying.spec.js +0 -114
  41. package/cypress/e2e/.examples/spies_stubs_clocks.spec.js +0 -205
  42. package/cypress/e2e/.examples/traversal.spec.js +0 -121
  43. package/cypress/e2e/.examples/utilities.spec.js +0 -110
  44. package/cypress/e2e/.examples/viewport.spec.js +0 -59
  45. package/cypress/e2e/.examples/waiting.spec.js +0 -31
  46. package/cypress/e2e/.examples/window.spec.js +0 -22
  47. package/cypress/e2e/booking.spec.js +0 -81
  48. package/cypress/e2e/calendar.spec.js +0 -21
  49. package/cypress/e2e/search.spec.js +0 -25
  50. package/cypress/fixtures/example.json +0 -5
  51. package/cypress/plugins/index.js +0 -16
  52. package/cypress/support/commands.js +0 -25
  53. package/cypress/support/commands.ts +0 -37
  54. package/cypress/support/component-index.html +0 -12
  55. package/cypress/support/component.ts +0 -39
  56. package/cypress/support/e2e.js +0 -20
  57. package/cypress.config.ts +0 -15
  58. package/dev.tsx +0 -44
  59. package/index.html +0 -15
  60. package/invalid-calendar.html +0 -16
  61. package/jest.config.js +0 -195
  62. package/postcss.config.js +0 -17
  63. package/reviews.html +0 -16
  64. package/src/_lib/SearchQueries.ts +0 -145
  65. package/src/_lib/Tracking.ts +0 -51
  66. package/src/_lib/countries/de.json +0 -998
  67. package/src/_lib/countries/en.json +0 -998
  68. package/src/_lib/countries/es.json +0 -998
  69. package/src/_lib/countries/fr.json +0 -998
  70. package/src/_lib/countries/it.json +0 -998
  71. package/src/_lib/countries/nl.json +0 -998
  72. package/src/_lib/countries.ts +0 -15
  73. package/src/_lib/date_helper.ts +0 -27
  74. package/src/_lib/queries.ts +0 -244
  75. package/src/components/App.tsx +0 -108
  76. package/src/components/AppContext.ts +0 -14
  77. package/src/components/CalendarPage/BookingForm.tsx +0 -49
  78. package/src/components/CalendarPage/Calendar.tsx +0 -49
  79. package/src/components/CalendarPage/CalendarPage.tsx +0 -43
  80. package/src/components/CalendarPage/CalendarParts/CalendarContext.tsx +0 -89
  81. package/src/components/CalendarPage/CalendarParts/CalendarHeader.tsx +0 -72
  82. package/src/components/CalendarPage/CalendarParts/DayClasses.ts +0 -113
  83. package/src/components/CalendarPage/CalendarParts/GenerateCalendar.tsx +0 -72
  84. package/src/components/CalendarPage/CalendarParts/Legend.tsx +0 -33
  85. package/src/components/CalendarPage/CalendarParts/MonthHeader.tsx +0 -15
  86. package/src/components/CalendarPage/CalendarParts/Months.tsx +0 -37
  87. package/src/components/CalendarPage/CalendarParts/RenderCells.tsx +0 -97
  88. package/src/components/CalendarPage/CalendarParts/SingleMonth.tsx +0 -72
  89. package/src/components/CalendarPage/CalendarParts/StartBooking.tsx +0 -17
  90. package/src/components/CalendarPage/CalendarParts/WeekDays.tsx +0 -27
  91. package/src/components/CalendarPage/FormCreator.tsx +0 -230
  92. package/src/components/CalendarPage/FormItems/Date.tsx +0 -61
  93. package/src/components/CalendarPage/FormItems/NumberSelect.tsx +0 -39
  94. package/src/components/CalendarPage/FormItems/Select.tsx +0 -38
  95. package/src/components/CalendarPage/FormItems/index.ts +0 -4
  96. package/src/components/CalendarPage/PriceField/Price.tsx +0 -58
  97. package/src/components/CalendarPage/PriceField/Queries.ts +0 -23
  98. package/src/components/CalendarPage/PriceField/index.tsx +0 -129
  99. package/src/components/CalendarPage/Summary/CostRow.tsx +0 -58
  100. package/src/components/CalendarPage/Summary/CostSection.tsx +0 -15
  101. package/src/components/CalendarPage/Summary/CostSummary.tsx +0 -61
  102. package/src/components/CalendarPage/Summary/Description.tsx +0 -27
  103. package/src/components/CalendarPage/Summary/InsurancesAndRequired.tsx +0 -68
  104. package/src/components/CalendarPage/Summary/Object.tsx +0 -59
  105. package/src/components/CalendarPage/Summary/OnSite.tsx +0 -36
  106. package/src/components/CalendarPage/Summary/OptionalNotOnSite.tsx +0 -43
  107. package/src/components/CalendarPage/Summary/OptionalOnSite.tsx +0 -39
  108. package/src/components/CalendarPage/Summary/Queries.ts +0 -31
  109. package/src/components/CalendarPage/Summary/RentAndDiscount.tsx +0 -30
  110. package/src/components/CalendarPage/Summary/Totals.tsx +0 -89
  111. package/src/components/CalendarPage/Summary/cost_types.d.ts +0 -31
  112. package/src/components/CalendarPage/Summary/index.tsx +0 -24
  113. package/src/components/CalendarPage/calender_types.d.ts +0 -16
  114. package/src/components/CalendarPage/formParts/AssistanceMessage.tsx +0 -60
  115. package/src/components/CalendarPage/formParts/BookingHelpers.tsx +0 -47
  116. package/src/components/CalendarPage/formParts/BookingOrOption.tsx +0 -35
  117. package/src/components/CalendarPage/formParts/CancelInsuranceText.tsx +0 -69
  118. package/src/components/CalendarPage/formParts/DefaultBookingFields.ts +0 -105
  119. package/src/components/CalendarPage/formParts/DiscountCode.tsx +0 -62
  120. package/src/components/CalendarPage/formParts/Guests.tsx +0 -77
  121. package/src/components/CalendarPage/formParts/OptionalBookingFields.tsx +0 -148
  122. package/src/components/CalendarPage/formParts/OptionalCosts.tsx +0 -103
  123. package/src/components/CalendarPage/formParts/SuccessMessage.tsx +0 -31
  124. package/src/components/CalendarPage/formParts/Validations.tsx +0 -64
  125. package/src/components/CalendarPage/formParts/discount.tsx +0 -69
  126. package/src/components/CalendarPage/formParts/form_types.d.ts +0 -38
  127. package/src/components/CalendarPage/formParts/insurances.tsx +0 -62
  128. package/src/components/CalendarPage/formParts/radioButtons.tsx +0 -66
  129. package/src/components/Error/ApiError.tsx +0 -33
  130. package/src/components/Error/IntegrationError.tsx +0 -62
  131. package/src/components/Error/index.ts +0 -4
  132. package/src/components/ErrorBoundary.tsx +0 -34
  133. package/src/components/Modal/index.tsx +0 -46
  134. package/src/components/ReviewsPage/Queries.ts +0 -26
  135. package/src/components/ReviewsPage/ReviewsPage.tsx +0 -45
  136. package/src/components/ReviewsPage/Score.tsx +0 -29
  137. package/src/components/ReviewsPage/SingleReview.tsx +0 -38
  138. package/src/components/ReviewsPage/note.tsx +0 -17
  139. package/src/components/SafeBooking.tsx +0 -96
  140. package/src/components/SearchPage/Field.tsx +0 -75
  141. package/src/components/SearchPage/Filters.tsx +0 -91
  142. package/src/components/SearchPage/Paginator.tsx +0 -63
  143. package/src/components/SearchPage/Results.tsx +0 -129
  144. package/src/components/SearchPage/SearchPage.tsx +0 -115
  145. package/src/components/SearchPage/SingleResult.tsx +0 -93
  146. package/src/components/SearchPage/filters/Categories.tsx +0 -57
  147. package/src/components/SearchPage/filters/DateFilter.tsx +0 -34
  148. package/src/components/SearchPage/filters/List.tsx +0 -80
  149. package/src/components/SearchPage/filters/NumberFilter.tsx +0 -37
  150. package/src/components/SearchPage/filters/Radio.tsx +0 -46
  151. package/src/components/SearchPage/filters/Select.tsx +0 -85
  152. package/src/components/SearchPage/filters/__tests__/helper.spec.js +0 -13
  153. package/src/components/SearchPage/filters/filter_types.d.ts +0 -25
  154. package/src/components/SearchPage/filters/helper.ts +0 -19
  155. package/src/components/icons/ArrowLeft.svg.tsx +0 -20
  156. package/src/components/icons/ArrowRight.svg.tsx +0 -16
  157. package/src/components/icons/Reload.svg.tsx +0 -23
  158. package/src/components/icons/info.svg.tsx +0 -24
  159. package/src/components/icons/loading.svg.tsx +0 -98
  160. package/src/custom.d.ts +0 -10
  161. package/src/index.tsx +0 -104
  162. package/src/locales/de.json +0 -137
  163. package/src/locales/en.json +0 -137
  164. package/src/locales/es.json +0 -132
  165. package/src/locales/fr.json +0 -132
  166. package/src/locales/it.json +0 -128
  167. package/src/locales/nl.json +0 -138
  168. package/src/styles/calendar.css +0 -317
  169. package/src/styles/datepicker.css +0 -6
  170. package/src/styles/field.css +0 -105
  171. package/src/styles/filters.css +0 -92
  172. package/src/styles/form.css +0 -219
  173. package/src/styles/main.css +0 -80
  174. package/src/styles/modal.css +0 -79
  175. package/src/styles/pagination.css +0 -92
  176. package/src/styles/price-overview.css +0 -111
  177. package/src/styles/result.css +0 -142
  178. package/src/styles/results.css +0 -50
  179. package/src/styles/reviews.css +0 -90
  180. package/src/styles/success.css +0 -9
  181. package/src/types.d.ts +0 -91
  182. package/tmp/cache/vite/last-build-production.json +0 -7
  183. package/tsconfig.json +0 -17
  184. package/vite.config.ts +0 -31
@@ -1,202 +0,0 @@
1
- /// <reference types="cypress" />
2
-
3
- context('Cypress.Commands', () => {
4
- beforeEach(() => {
5
- cy.visit('https://example.cypress.io/cypress-api')
6
- })
7
-
8
- // https://on.cypress.io/custom-commands
9
-
10
- it('.add() - create a custom command', () => {
11
- Cypress.Commands.add('console', {
12
- prevSubject: true,
13
- }, (subject, method) => {
14
- // the previous subject is automatically received
15
- // and the commands arguments are shifted
16
-
17
- // allow us to change the console method used
18
- method = method || 'log'
19
-
20
- // log the subject to the console
21
- // @ts-ignore TS7017
22
- console[method]('The subject is', subject)
23
-
24
- // whatever we return becomes the new subject
25
- // we don't want to change the subject so
26
- // we return whatever was passed in
27
- return subject
28
- })
29
-
30
- // @ts-ignore TS2339
31
- cy.get('button').console('info').then(($button) => {
32
- // subject is still $button
33
- })
34
- })
35
- })
36
-
37
- context('Cypress.Cookies', () => {
38
- beforeEach(() => {
39
- cy.visit('https://example.cypress.io/cypress-api')
40
- })
41
-
42
- // https://on.cypress.io/cookies
43
- it('.debug() - enable or disable debugging', () => {
44
- Cypress.Cookies.debug(true)
45
-
46
- // Cypress will now log in the console when
47
- // cookies are set or cleared
48
- cy.setCookie('fakeCookie', '123ABC')
49
- cy.clearCookie('fakeCookie')
50
- cy.setCookie('fakeCookie', '123ABC')
51
- cy.clearCookie('fakeCookie')
52
- cy.setCookie('fakeCookie', '123ABC')
53
- })
54
-
55
- it('.preserveOnce() - preserve cookies by key', () => {
56
- // normally cookies are reset after each test
57
- cy.getCookie('fakeCookie').should('not.be.ok')
58
-
59
- // preserving a cookie will not clear it when
60
- // the next test starts
61
- cy.setCookie('lastCookie', '789XYZ')
62
- Cypress.Cookies.preserveOnce('lastCookie')
63
- })
64
-
65
- it('.defaults() - set defaults for all cookies', () => {
66
- // now any cookie with the name 'session_id' will
67
- // not be cleared before each new test runs
68
- Cypress.Cookies.defaults({
69
- preserve: 'session_id',
70
- })
71
- })
72
- })
73
-
74
- context('Cypress.arch', () => {
75
- beforeEach(() => {
76
- cy.visit('https://example.cypress.io/cypress-api')
77
- })
78
-
79
- it('Get CPU architecture name of underlying OS', () => {
80
- // https://on.cypress.io/arch
81
- expect(Cypress.arch).to.exist
82
- })
83
- })
84
-
85
- context('Cypress.config()', () => {
86
- beforeEach(() => {
87
- cy.visit('https://example.cypress.io/cypress-api')
88
- })
89
-
90
- it('Get and set configuration options', () => {
91
- // https://on.cypress.io/config
92
- let myConfig = Cypress.config()
93
-
94
- expect(myConfig).to.have.property('animationDistanceThreshold', 5)
95
- expect(myConfig).to.have.property('baseUrl', null)
96
- expect(myConfig).to.have.property('defaultCommandTimeout', 4000)
97
- expect(myConfig).to.have.property('requestTimeout', 5000)
98
- expect(myConfig).to.have.property('responseTimeout', 30000)
99
- expect(myConfig).to.have.property('viewportHeight', 660)
100
- expect(myConfig).to.have.property('viewportWidth', 1000)
101
- expect(myConfig).to.have.property('pageLoadTimeout', 60000)
102
- expect(myConfig).to.have.property('waitForAnimations', true)
103
-
104
- expect(Cypress.config('pageLoadTimeout')).to.eq(60000)
105
-
106
- // this will change the config for the rest of your tests!
107
- Cypress.config('pageLoadTimeout', 20000)
108
-
109
- expect(Cypress.config('pageLoadTimeout')).to.eq(20000)
110
-
111
- Cypress.config('pageLoadTimeout', 60000)
112
- })
113
- })
114
-
115
- context('Cypress.dom', () => {
116
- beforeEach(() => {
117
- cy.visit('https://example.cypress.io/cypress-api')
118
- })
119
-
120
- // https://on.cypress.io/dom
121
- it('.isHidden() - determine if a DOM element is hidden', () => {
122
- let hiddenP = Cypress.$('.dom-p p.hidden').get(0)
123
- let visibleP = Cypress.$('.dom-p p.visible').get(0)
124
-
125
- // our first paragraph has css class 'hidden'
126
- expect(Cypress.dom.isHidden(hiddenP)).to.be.true
127
- expect(Cypress.dom.isHidden(visibleP)).to.be.false
128
- })
129
- })
130
-
131
- context('Cypress.env()', () => {
132
- beforeEach(() => {
133
- cy.visit('https://example.cypress.io/cypress-api')
134
- })
135
-
136
- // We can set environment variables for highly dynamic values
137
-
138
- // https://on.cypress.io/environment-variables
139
- it('Get environment variables', () => {
140
- // https://on.cypress.io/env
141
- // set multiple environment variables
142
- Cypress.env({
143
- host: 'veronica.dev.local',
144
- api_server: 'http://localhost:8888/v1/',
145
- })
146
-
147
- // get environment variable
148
- expect(Cypress.env('host')).to.eq('veronica.dev.local')
149
-
150
- // set environment variable
151
- Cypress.env('api_server', 'http://localhost:8888/v2/')
152
- expect(Cypress.env('api_server')).to.eq('http://localhost:8888/v2/')
153
-
154
- // get all environment variable
155
- expect(Cypress.env()).to.have.property('host', 'veronica.dev.local')
156
- expect(Cypress.env()).to.have.property('api_server', 'http://localhost:8888/v2/')
157
- })
158
- })
159
-
160
- context('Cypress.log', () => {
161
- beforeEach(() => {
162
- cy.visit('https://example.cypress.io/cypress-api')
163
- })
164
-
165
- it('Control what is printed to the Command Log', () => {
166
- // https://on.cypress.io/cypress-log
167
- })
168
- })
169
-
170
- context('Cypress.platform', () => {
171
- beforeEach(() => {
172
- cy.visit('https://example.cypress.io/cypress-api')
173
- })
174
-
175
- it('Get underlying OS name', () => {
176
- // https://on.cypress.io/platform
177
- expect(Cypress.platform).to.be.exist
178
- })
179
- })
180
-
181
- context('Cypress.version', () => {
182
- beforeEach(() => {
183
- cy.visit('https://example.cypress.io/cypress-api')
184
- })
185
-
186
- it('Get current version of Cypress being run', () => {
187
- // https://on.cypress.io/version
188
- expect(Cypress.version).to.be.exist
189
- })
190
- })
191
-
192
- context('Cypress.spec', () => {
193
- beforeEach(() => {
194
- cy.visit('https://example.cypress.io/cypress-api')
195
- })
196
-
197
- it('Get current spec information', () => {
198
- // https://on.cypress.io/spec
199
- // wrap the object so we can inspect it easily by clicking in the command log
200
- cy.wrap(Cypress.spec).should('include.keys', ['name', 'relative', 'absolute'])
201
- })
202
- })
@@ -1,89 +0,0 @@
1
- /// <reference types="cypress" />
2
-
3
- /// JSON fixture file can be loaded directly using
4
- // the built-in JavaScript bundler
5
- // @ts-ignore
6
- const requiredExample = require('../../fixtures/example')
7
-
8
- context('Files', () => {
9
- beforeEach(() => {
10
- cy.visit('https://example.cypress.io/commands/files')
11
- })
12
-
13
- beforeEach(() => {
14
- // load example.json fixture file and store
15
- // in the test context object
16
- cy.fixture('example.json').as('example')
17
- })
18
-
19
- it('cy.fixture() - load a fixture', () => {
20
- // https://on.cypress.io/fixture
21
-
22
- // Instead of writing a response inline you can
23
- // use a fixture file's content.
24
-
25
- // when application makes an Ajax request matching "GET **/comments/*"
26
- // Cypress will intercept it and reply with the object in `example.json` fixture
27
- cy.intercept('GET', '**/comments/*', { fixture: 'example.json' }).as('getComment')
28
-
29
- // we have code that gets a comment when
30
- // the button is clicked in scripts.js
31
- cy.get('.fixture-btn').click()
32
-
33
- cy.wait('@getComment').its('response.body')
34
- .should('have.property', 'name')
35
- .and('include', 'Using fixtures to represent data')
36
- })
37
-
38
- it('cy.fixture() or require - load a fixture', function () {
39
- // we are inside the "function () { ... }"
40
- // callback and can use test context object "this"
41
- // "this.example" was loaded in "beforeEach" function callback
42
- expect(this.example, 'fixture in the test context')
43
- .to.deep.equal(requiredExample)
44
-
45
- // or use "cy.wrap" and "should('deep.equal', ...)" assertion
46
- // @ts-ignore
47
- cy.wrap(this.example, 'fixture vs require')
48
- .should('deep.equal', requiredExample)
49
- })
50
-
51
- it('cy.readFile() - read file contents', () => {
52
- // https://on.cypress.io/readfile
53
-
54
- // You can read a file and yield its contents
55
- // The filePath is relative to your project's root.
56
- cy.readFile('cypress.json').then((json) => {
57
- expect(json).to.be.an('object')
58
- })
59
- })
60
-
61
- it('cy.writeFile() - write to a file', () => {
62
- // https://on.cypress.io/writefile
63
-
64
- // You can write to a file
65
-
66
- // Use a response from a request to automatically
67
- // generate a fixture file for use later
68
- cy.request('https://jsonplaceholder.cypress.io/users')
69
- .then((response) => {
70
- cy.writeFile('cypress/fixtures/users.json', response.body)
71
- })
72
-
73
- cy.fixture('users').should((users) => {
74
- expect(users[0].name).to.exist
75
- })
76
-
77
- // JavaScript arrays and objects are stringified
78
- // and formatted into text.
79
- cy.writeFile('cypress/fixtures/profile.json', {
80
- id: 8739,
81
- name: 'Jane',
82
- email: 'jane@example.com',
83
- })
84
-
85
- cy.fixture('profile').should((profile) => {
86
- expect(profile.name).to.eq('Jane')
87
- })
88
- })
89
- })
@@ -1,52 +0,0 @@
1
- /// <reference types="cypress" />
2
-
3
- context('Local Storage', () => {
4
- beforeEach(() => {
5
- cy.visit('https://example.cypress.io/commands/local-storage')
6
- })
7
- // Although local storage is automatically cleared
8
- // in between tests to maintain a clean state
9
- // sometimes we need to clear the local storage manually
10
-
11
- it('cy.clearLocalStorage() - clear all data in local storage', () => {
12
- // https://on.cypress.io/clearlocalstorage
13
- cy.get('.ls-btn').click().should(() => {
14
- expect(localStorage.getItem('prop1')).to.eq('red')
15
- expect(localStorage.getItem('prop2')).to.eq('blue')
16
- expect(localStorage.getItem('prop3')).to.eq('magenta')
17
- })
18
-
19
- // clearLocalStorage() yields the localStorage object
20
- cy.clearLocalStorage().should((ls) => {
21
- expect(ls.getItem('prop1')).to.be.null
22
- expect(ls.getItem('prop2')).to.be.null
23
- expect(ls.getItem('prop3')).to.be.null
24
- })
25
-
26
- // Clear key matching string in Local Storage
27
- cy.get('.ls-btn').click().should(() => {
28
- expect(localStorage.getItem('prop1')).to.eq('red')
29
- expect(localStorage.getItem('prop2')).to.eq('blue')
30
- expect(localStorage.getItem('prop3')).to.eq('magenta')
31
- })
32
-
33
- cy.clearLocalStorage('prop1').should((ls) => {
34
- expect(ls.getItem('prop1')).to.be.null
35
- expect(ls.getItem('prop2')).to.eq('blue')
36
- expect(ls.getItem('prop3')).to.eq('magenta')
37
- })
38
-
39
- // Clear keys matching regex in Local Storage
40
- cy.get('.ls-btn').click().should(() => {
41
- expect(localStorage.getItem('prop1')).to.eq('red')
42
- expect(localStorage.getItem('prop2')).to.eq('blue')
43
- expect(localStorage.getItem('prop3')).to.eq('magenta')
44
- })
45
-
46
- cy.clearLocalStorage(/prop1|2/).should((ls) => {
47
- expect(ls.getItem('prop1')).to.be.null
48
- expect(ls.getItem('prop2')).to.be.null
49
- expect(ls.getItem('prop3')).to.eq('magenta')
50
- })
51
- })
52
- })
@@ -1,32 +0,0 @@
1
- /// <reference types="cypress" />
2
-
3
- context('Location', () => {
4
- beforeEach(() => {
5
- cy.visit('https://example.cypress.io/commands/location')
6
- })
7
-
8
- it('cy.hash() - get the current URL hash', () => {
9
- // https://on.cypress.io/hash
10
- cy.hash().should('be.empty')
11
- })
12
-
13
- it('cy.location() - get window.location', () => {
14
- // https://on.cypress.io/location
15
- cy.location().should((location) => {
16
- expect(location.hash).to.be.empty
17
- expect(location.href).to.eq('https://example.cypress.io/commands/location')
18
- expect(location.host).to.eq('example.cypress.io')
19
- expect(location.hostname).to.eq('example.cypress.io')
20
- expect(location.origin).to.eq('https://example.cypress.io')
21
- expect(location.pathname).to.eq('/commands/location')
22
- expect(location.port).to.eq('')
23
- expect(location.protocol).to.eq('https:')
24
- expect(location.search).to.be.empty
25
- })
26
- })
27
-
28
- it('cy.url() - get the current URL', () => {
29
- // https://on.cypress.io/url
30
- cy.url().should('eq', 'https://example.cypress.io/commands/location')
31
- })
32
- })
@@ -1,104 +0,0 @@
1
- /// <reference types="cypress" />
2
-
3
- context('Misc', () => {
4
- beforeEach(() => {
5
- cy.visit('https://example.cypress.io/commands/misc')
6
- })
7
-
8
- it('.end() - end the command chain', () => {
9
- // https://on.cypress.io/end
10
-
11
- // cy.end is useful when you want to end a chain of commands
12
- // and force Cypress to re-query from the root element
13
- cy.get('.misc-table').within(() => {
14
- // ends the current chain and yields null
15
- cy.contains('Cheryl').click().end()
16
-
17
- // queries the entire table again
18
- cy.contains('Charles').click()
19
- })
20
- })
21
-
22
- it('cy.exec() - execute a system command', () => {
23
- // execute a system command.
24
- // so you can take actions necessary for
25
- // your test outside the scope of Cypress.
26
- // https://on.cypress.io/exec
27
-
28
- // we can use Cypress.platform string to
29
- // select appropriate command
30
- // https://on.cypress/io/platform
31
- cy.log(`Platform ${Cypress.platform} architecture ${Cypress.arch}`)
32
-
33
- // on CircleCI Windows build machines we have a failure to run bash shell
34
- // https://github.com/cypress-io/cypress/issues/5169
35
- // so skip some of the tests by passing flag "--env circle=true"
36
- const isCircleOnWindows = Cypress.platform === 'win32' && Cypress.env('circle')
37
-
38
- if (isCircleOnWindows) {
39
- cy.log('Skipping test on CircleCI')
40
-
41
- return
42
- }
43
-
44
- // cy.exec problem on Shippable CI
45
- // https://github.com/cypress-io/cypress/issues/6718
46
- const isShippable = Cypress.platform === 'linux' && Cypress.env('shippable')
47
-
48
- if (isShippable) {
49
- cy.log('Skipping test on ShippableCI')
50
-
51
- return
52
- }
53
-
54
- cy.exec('echo Jane Lane')
55
- .its('stdout').should('contain', 'Jane Lane')
56
-
57
- if (Cypress.platform === 'win32') {
58
- cy.exec('print cypress.json')
59
- .its('stderr').should('be.empty')
60
- } else {
61
- cy.exec('cat cypress.json')
62
- .its('stderr').should('be.empty')
63
-
64
- cy.exec('pwd')
65
- .its('code').should('eq', 0)
66
- }
67
- })
68
-
69
- it('cy.focused() - get the DOM element that has focus', () => {
70
- // https://on.cypress.io/focused
71
- cy.get('.misc-form').find('#name').click()
72
- cy.focused().should('have.id', 'name')
73
-
74
- cy.get('.misc-form').find('#description').click()
75
- cy.focused().should('have.id', 'description')
76
- })
77
-
78
- context('Cypress.Screenshot', function () {
79
- it('cy.screenshot() - take a screenshot', () => {
80
- // https://on.cypress.io/screenshot
81
- cy.screenshot('my-image')
82
- })
83
-
84
- it('Cypress.Screenshot.defaults() - change default config of screenshots', function () {
85
- Cypress.Screenshot.defaults({
86
- blackout: ['.foo'],
87
- capture: 'viewport',
88
- clip: { x: 0, y: 0, width: 200, height: 200 },
89
- scale: false,
90
- disableTimersAndAnimations: true,
91
- screenshotOnRunFailure: true,
92
- onBeforeScreenshot () { },
93
- onAfterScreenshot () { },
94
- })
95
- })
96
- })
97
-
98
- it('cy.wrap() - wrap an object', () => {
99
- // https://on.cypress.io/wrap
100
- cy.wrap({ foo: 'bar' })
101
- .should('have.property', 'foo')
102
- .and('include', 'bar')
103
- })
104
- })
@@ -1,56 +0,0 @@
1
- /// <reference types="cypress" />
2
-
3
- context('Navigation', () => {
4
- beforeEach(() => {
5
- cy.visit('https://example.cypress.io')
6
- cy.get('.navbar-nav').contains('Commands').click()
7
- cy.get('.dropdown-menu').contains('Navigation').click()
8
- })
9
-
10
- it('cy.go() - go back or forward in the browser\'s history', () => {
11
- // https://on.cypress.io/go
12
-
13
- cy.location('pathname').should('include', 'navigation')
14
-
15
- cy.go('back')
16
- cy.location('pathname').should('not.include', 'navigation')
17
-
18
- cy.go('forward')
19
- cy.location('pathname').should('include', 'navigation')
20
-
21
- // clicking back
22
- cy.go(-1)
23
- cy.location('pathname').should('not.include', 'navigation')
24
-
25
- // clicking forward
26
- cy.go(1)
27
- cy.location('pathname').should('include', 'navigation')
28
- })
29
-
30
- it('cy.reload() - reload the page', () => {
31
- // https://on.cypress.io/reload
32
- cy.reload()
33
-
34
- // reload the page without using the cache
35
- cy.reload(true)
36
- })
37
-
38
- it('cy.visit() - visit a remote url', () => {
39
- // https://on.cypress.io/visit
40
-
41
- // Visit any sub-domain of your current domain
42
-
43
- // Pass options to the visit
44
- cy.visit('https://example.cypress.io/commands/navigation', {
45
- timeout: 50000, // increase total time for the visit to resolve
46
- onBeforeLoad (contentWindow) {
47
- // contentWindow is the remote page's window object
48
- expect(typeof contentWindow === 'object').to.be.true
49
- },
50
- onLoad (contentWindow) {
51
- // contentWindow is the remote page's window object
52
- expect(typeof contentWindow === 'object').to.be.true
53
- },
54
- })
55
- })
56
- })