/
unsupported_commands.cy.ts
66 lines (56 loc) · 2.6 KB
/
unsupported_commands.cy.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
context('cy.origin unsupported commands', { browser: '!webkit' }, () => {
beforeEach(() => {
cy.visit('/fixtures/primary-origin.html')
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
})
it('cy.route() method is deprecated', (done) => {
cy.on('fail', (err) => {
expect(err.message).to.equal('`cy.route()` has been deprecated and its use is not supported in the `cy.origin()` callback. Consider using `cy.intercept()` (outside of the callback) instead.')
expect(err.docsUrl).to.equal('https://on.cypress.io/intercept')
done()
})
cy.origin('http://www.foobar.com:3500', () => {
cy.route('api')
})
})
it('cy.server() method is deprecated', (done) => {
cy.on('fail', (err) => {
expect(err.message).to.equal('`cy.server()` has been deprecated and its use is not supported in the `cy.origin()` callback. Consider using `cy.intercept()` (outside of the callback) instead.')
expect(err.docsUrl).to.equal('https://on.cypress.io/intercept')
done()
})
cy.origin('http://www.foobar.com:3500', () => {
cy.server()
})
})
it('cy.origin() is not yet supported', (done) => {
cy.on('fail', (err) => {
expect(err.message).to.equal('`cy.origin()` use is not currently supported in the `cy.origin()` callback, but is planned for a future release. Please 👍 the following issue and leave a comment with your use-case:')
expect(err.docsUrl).to.equal('https://on.cypress.io/github-issue/20718')
done()
})
cy.origin('http://www.foobar.com:3500', () => {
cy.origin('barbaz.com', () => {})
})
})
it('cy.intercept() is not supported', (done) => {
cy.on('fail', (err) => {
expect(err.message).to.equal('`cy.intercept()` use is not supported in the `cy.origin()` callback. Consider using it outside of the callback instead. Otherwise, please 👍 the following issue and leave a comment with your use-case:')
expect(err.docsUrl).to.equal('https://on.cypress.io/github-issue/20720')
done()
})
cy.origin('http://www.foobar.com:3500', () => {
cy.intercept('/foo')
})
})
it('cy.session() is not supported', (done) => {
cy.on('fail', (err) => {
expect(err.message).to.equal('`cy.session()` use is not supported in the `cy.origin()` callback. Consider using it outside of the callback instead. Otherwise, please 👍 the following issue and leave a comment with your use-case:')
expect(err.docsUrl).to.equal('https://on.cypress.io/github-issue/20721')
done()
})
cy.origin('http://www.foobar.com:3500', () => {
cy.session('/foo', () => {})
})
})
})