cypress-on-rails 1.12.1 → 1.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +3 -3
- data/.gitignore +4 -1
- data/CHANGELOG.md +13 -0
- data/README.md +91 -5
- data/cypress-on-rails.gemspec +1 -0
- data/lib/cypress-on-rails.rb +2 -2
- data/lib/cypress_on_rails/configuration.rb +3 -0
- data/lib/cypress_on_rails/middleware.rb +6 -10
- data/lib/cypress_on_rails/middleware_config.rb +17 -0
- data/lib/cypress_on_rails/railtie.rb +5 -1
- data/lib/cypress_on_rails/vcr_middleware.rb +73 -0
- data/lib/cypress_on_rails/version.rb +1 -1
- data/lib/generators/cypress_on_rails/install_generator.rb +18 -24
- data/lib/generators/cypress_on_rails/templates/config/initializers/cypress_on_rails.rb.erb +1 -0
- data/lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/clean.rb +6 -0
- data/lib/generators/cypress_on_rails/templates/spec/cypress/{cypress_helper.rb → cypress_helper.rb.erb} +5 -0
- data/lib/generators/cypress_on_rails/templates/spec/cypress/e2e/rails_examples/using_vcr.cy.js +24 -0
- data/lib/generators/cypress_on_rails/templates/spec/cypress/support/{index.js → index.js.erb} +1 -0
- data/lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js +1 -1
- data/lib/generators/cypress_on_rails/templates/spec/cypress.config.js +9 -0
- data/plugin/.gitignore +1 -0
- data/plugin/cypress/plugins/index.js +4 -0
- data/plugin/package.json +31 -0
- data/plugin/support/index.js +37 -0
- data/spec/cypress_on_rails/middleware_spec.rb +3 -1
- data/spec/cypress_on_rails/vcr_middleware_spec.rb +119 -0
- data/specs_e2e/cypress.config.js +10 -0
- data/{spec/integrations → specs_e2e}/rails_3_2/.gitignore +1 -1
- data/specs_e2e/rails_3_2/.ruby_version +1 -0
- data/{spec/integrations → specs_e2e}/rails_3_2/Gemfile +1 -1
- data/{spec/integrations → specs_e2e}/rails_3_2/test.sh +8 -7
- data/{spec/integrations → specs_e2e}/rails_4_2/.gitignore +3 -2
- data/{spec/integrations → specs_e2e}/rails_4_2/Gemfile +3 -1
- data/specs_e2e/rails_4_2/app/controllers/using_vcr_controller.rb +10 -0
- data/{spec/integrations → specs_e2e}/rails_4_2/app/models/post.rb +3 -1
- data/specs_e2e/rails_4_2/app/views/using_vcr/index.html.erb +6 -0
- data/specs_e2e/rails_4_2/app/views/using_vcr/record_cats.html.erb +7 -0
- data/{spec/integrations → specs_e2e}/rails_4_2/config/routes.rb +5 -0
- data/specs_e2e/rails_4_2/package.json +10 -0
- data/{spec/integrations → specs_e2e}/rails_4_2/test.sh +13 -12
- data/{spec/integrations → specs_e2e}/rails_5_2/.gitignore +1 -1
- data/{spec/integrations → specs_e2e}/rails_5_2/Gemfile +1 -1
- data/specs_e2e/rails_5_2/app/assets/javascripts/posts.js +2 -0
- data/specs_e2e/rails_5_2/app/assets/stylesheets/posts.css +4 -0
- data/{spec/integrations → specs_e2e}/rails_5_2/test.sh +8 -7
- metadata +177 -171
- data/lib/generators/cypress_on_rails/templates/spec/cypress/fixtures/example.json +0 -5
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/actions.spec.js +0 -272
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/aliasing.spec.js +0 -42
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/assertions.spec.js +0 -63
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/connectors.spec.js +0 -55
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/cookies.spec.js +0 -78
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/cypress_api.spec.js +0 -211
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/files.spec.js +0 -86
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/local_storage.spec.js +0 -52
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/location.spec.js +0 -32
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/misc.spec.js +0 -68
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js +0 -54
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/network_requests.spec.js +0 -108
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/querying.spec.js +0 -65
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/spies_stubs_clocks.spec.js +0 -62
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/traversal.spec.js +0 -121
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/utilities.spec.js +0 -89
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/viewport.spec.js +0 -59
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/waiting.spec.js +0 -34
- data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/window.spec.js +0 -22
- data/lib/generators/cypress_on_rails/templates/spec/cypress.json +0 -4
- data/spec/integrations/cypress.json +0 -5
- data/spec/integrations/rails_5_2/log/.keep +0 -0
- data/spec/integrations/rails_5_2/tmp/.keep +0 -0
- data/spec/integrations/rails_5_2/vendor/.keep +0 -0
- /data/lib/generators/cypress_on_rails/templates/spec/cypress/{integration/rails_examples/advance_factory_bot_spec.js → e2e/rails_examples/advance_factory_bot.cy.js} +0 -0
- /data/lib/generators/cypress_on_rails/templates/spec/cypress/{integration/rails_examples/other_spec.js → e2e/rails_examples/other.cy.js} +0 -0
- /data/lib/generators/cypress_on_rails/templates/spec/cypress/{integration/rails_examples/using_factory_bot_spec.js → e2e/rails_examples/using_factory_bot.cy.js} +0 -0
- /data/lib/generators/cypress_on_rails/templates/spec/cypress/{integration/rails_examples/using_fixtures_spec.js → e2e/rails_examples/using_fixtures.cy.js} +0 -0
- /data/lib/generators/cypress_on_rails/templates/spec/cypress/{integration/rails_examples/using_scenarios_spec.js → e2e/rails_examples/using_scenarios.cy.js} +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/README.rdoc +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/Rakefile +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/app/assets/stylesheets/application.css +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/app/controllers/application_controller.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/app/controllers/welcome_controller.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/app/helpers/application_helper.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/app/models/post.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/app/views/layouts/application.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/app/views/welcome/index.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/bin/rails +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/application.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/boot.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/environment.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/environments/development.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/environments/production.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/environments/test.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/initializers/backtrace_silencers.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/initializers/inflections.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/initializers/mime_types.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/initializers/secret_token.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/initializers/session_store.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/initializers/wrap_parameters.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/locales/en.yml +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config/routes.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/config.ru +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/log/.keep +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/public/404.html +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/public/422.html +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/public/500.html +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/public/favicon.ico +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/public/robots.txt +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/tmp/.keep +0 -0
- /data/{spec/integrations → specs_e2e}/rails_3_2/vendor/.gitkeep +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/README.rdoc +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/Rakefile +0 -0
- /data/{spec/integrations/rails_5_2/app/assets/javascripts/posts.js → specs_e2e/rails_4_2/app/assets/javascripts/using_vcr.js} +0 -0
- /data/{spec/integrations/rails_5_2/app/assets/stylesheets/posts.css → specs_e2e/rails_4_2/app/assets/stylesheets/using_vcr.css} +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/app/controllers/application_controller.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/app/controllers/welcome_controller.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/app/views/layouts/application.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/app/views/welcome/index.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/bin/bundle +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/bin/rails +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/bin/rake +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/bin/setup +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/application.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/boot.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/environment.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/environments/development.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/environments/production.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/environments/test.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/backtrace_silencers.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/cookies_serializer.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/filter_parameter_logging.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/inflections.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/mime_types.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/session_store.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/to_time_preserves_timezone.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/wrap_parameters.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/locales/en.yml +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config/secrets.yml +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/config.ru +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/public/404.html +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/public/422.html +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/public/500.html +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/public/favicon.ico +0 -0
- /data/{spec/integrations → specs_e2e}/rails_4_2/public/robots.txt +0 -0
- /data/{spec/integrations/rails_4_2/log → specs_e2e/rails_4_2/spec}/.keep +0 -0
- /data/{spec/integrations/rails_4_2/spec → specs_e2e/rails_4_2/vendor}/.keep +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/README.md +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/Rakefile +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/assets/stylesheets/scaffold.css +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/controllers/application_controller.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/controllers/posts_controller.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/helpers/posts_helper.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/jobs/application_job.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/models/application_record.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/models/post.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/views/layouts/application.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/views/posts/_form.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/views/posts/edit.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/views/posts/index.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/views/posts/new.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/views/posts/show.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/app/views/welcome/index.html.erb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/bin/bundle +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/bin/rails +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/bin/rake +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/bin/setup +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/bin/update +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/application.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/boot.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/credentials.yml.enc +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/database.yml +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/environment.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/environments/development.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/environments/production.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/environments/test.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/initializers/application_controller_renderer.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/initializers/backtrace_silencers.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/initializers/content_security_policy.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/initializers/cookies_serializer.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/initializers/filter_parameter_logging.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/initializers/inflections.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/initializers/mime_types.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/initializers/wrap_parameters.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/locales/en.yml +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/master.key +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config/routes.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/config.ru +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/db/migrate/20180621085832_create_posts.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/public/404.html +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/public/422.html +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/public/500.html +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/public/apple-touch-icon-precomposed.png +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/public/apple-touch-icon.png +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/public/favicon.ico +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/public/robots.txt +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/test/controllers/posts_controller_test.rb +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/test/cypress_fixtures/posts.yml +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/test/fixtures/posts.yml +0 -0
- /data/{spec/integrations → specs_e2e}/rails_5_2/test/models/post_test.rb +0 -0
- /data/{spec/integrations/rails_4_2 → specs_e2e/rails_5_2}/vendor/.keep +0 -0
@@ -1,62 +0,0 @@
|
|
1
|
-
/// <reference types="Cypress" />
|
2
|
-
|
3
|
-
context('Spies, Stubs, and Clock', () => {
|
4
|
-
it('cy.spy() - wrap a method in a spy', () => {
|
5
|
-
// https://on.cypress.io/spy
|
6
|
-
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
7
|
-
|
8
|
-
let obj = {
|
9
|
-
foo () {},
|
10
|
-
}
|
11
|
-
|
12
|
-
let spy = cy.spy(obj, 'foo').as('anyArgs')
|
13
|
-
|
14
|
-
obj.foo()
|
15
|
-
|
16
|
-
expect(spy).to.be.called
|
17
|
-
})
|
18
|
-
|
19
|
-
it('cy.stub() - create a stub and/or replace a function with stub', () => {
|
20
|
-
// https://on.cypress.io/stub
|
21
|
-
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
22
|
-
|
23
|
-
let obj = {
|
24
|
-
foo () {},
|
25
|
-
}
|
26
|
-
|
27
|
-
let stub = cy.stub(obj, 'foo').as('foo')
|
28
|
-
|
29
|
-
obj.foo('foo', 'bar')
|
30
|
-
|
31
|
-
expect(stub).to.be.called
|
32
|
-
})
|
33
|
-
|
34
|
-
it('cy.clock() - control time in the browser', () => {
|
35
|
-
// https://on.cypress.io/clock
|
36
|
-
|
37
|
-
// create the date in UTC so its always the same
|
38
|
-
// no matter what local timezone the browser is running in
|
39
|
-
let now = new Date(Date.UTC(2017, 2, 14)).getTime()
|
40
|
-
|
41
|
-
cy.clock(now)
|
42
|
-
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
43
|
-
cy.get('#clock-div').click()
|
44
|
-
.should('have.text', '1489449600')
|
45
|
-
})
|
46
|
-
|
47
|
-
it('cy.tick() - move time in the browser', () => {
|
48
|
-
// https://on.cypress.io/tick
|
49
|
-
|
50
|
-
// create the date in UTC so its always the same
|
51
|
-
// no matter what local timezone the browser is running in
|
52
|
-
let now = new Date(Date.UTC(2017, 2, 14)).getTime()
|
53
|
-
|
54
|
-
cy.clock(now)
|
55
|
-
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
56
|
-
cy.get('#tick-div').click()
|
57
|
-
.should('have.text', '1489449600')
|
58
|
-
cy.tick(10000) // 10 seconds passed
|
59
|
-
cy.get('#tick-div').click()
|
60
|
-
.should('have.text', '1489449610')
|
61
|
-
})
|
62
|
-
})
|
data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/traversal.spec.js
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
/// <reference types="Cypress" />
|
2
|
-
|
3
|
-
context('Traversal', () => {
|
4
|
-
beforeEach(() => {
|
5
|
-
cy.visit('https://example.cypress.io/commands/traversal')
|
6
|
-
})
|
7
|
-
|
8
|
-
it('.children() - get child DOM elements', () => {
|
9
|
-
// https://on.cypress.io/children
|
10
|
-
cy.get('.traversal-breadcrumb')
|
11
|
-
.children('.active')
|
12
|
-
.should('contain', 'Data')
|
13
|
-
})
|
14
|
-
|
15
|
-
it('.closest() - get closest ancestor DOM element', () => {
|
16
|
-
// https://on.cypress.io/closest
|
17
|
-
cy.get('.traversal-badge')
|
18
|
-
.closest('ul')
|
19
|
-
.should('have.class', 'list-group')
|
20
|
-
})
|
21
|
-
|
22
|
-
it('.eq() - get a DOM element at a specific index', () => {
|
23
|
-
// https://on.cypress.io/eq
|
24
|
-
cy.get('.traversal-list>li')
|
25
|
-
.eq(1).should('contain', 'siamese')
|
26
|
-
})
|
27
|
-
|
28
|
-
it('.filter() - get DOM elements that match the selector', () => {
|
29
|
-
// https://on.cypress.io/filter
|
30
|
-
cy.get('.traversal-nav>li')
|
31
|
-
.filter('.active').should('contain', 'About')
|
32
|
-
})
|
33
|
-
|
34
|
-
it('.find() - get descendant DOM elements of the selector', () => {
|
35
|
-
// https://on.cypress.io/find
|
36
|
-
cy.get('.traversal-pagination')
|
37
|
-
.find('li').find('a')
|
38
|
-
.should('have.length', 7)
|
39
|
-
})
|
40
|
-
|
41
|
-
it('.first() - get first DOM element', () => {
|
42
|
-
// https://on.cypress.io/first
|
43
|
-
cy.get('.traversal-table td')
|
44
|
-
.first().should('contain', '1')
|
45
|
-
})
|
46
|
-
|
47
|
-
it('.last() - get last DOM element', () => {
|
48
|
-
// https://on.cypress.io/last
|
49
|
-
cy.get('.traversal-buttons .btn')
|
50
|
-
.last().should('contain', 'Submit')
|
51
|
-
})
|
52
|
-
|
53
|
-
it('.next() - get next sibling DOM element', () => {
|
54
|
-
// https://on.cypress.io/next
|
55
|
-
cy.get('.traversal-ul')
|
56
|
-
.contains('apples').next().should('contain', 'oranges')
|
57
|
-
})
|
58
|
-
|
59
|
-
it('.nextAll() - get all next sibling DOM elements', () => {
|
60
|
-
// https://on.cypress.io/nextall
|
61
|
-
cy.get('.traversal-next-all')
|
62
|
-
.contains('oranges')
|
63
|
-
.nextAll().should('have.length', 3)
|
64
|
-
})
|
65
|
-
|
66
|
-
it('.nextUntil() - get next sibling DOM elements until next el', () => {
|
67
|
-
// https://on.cypress.io/nextuntil
|
68
|
-
cy.get('#veggies')
|
69
|
-
.nextUntil('#nuts').should('have.length', 3)
|
70
|
-
})
|
71
|
-
|
72
|
-
it('.not() - remove DOM elements from set of DOM elements', () => {
|
73
|
-
// https://on.cypress.io/not
|
74
|
-
cy.get('.traversal-disabled .btn')
|
75
|
-
.not('[disabled]').should('not.contain', 'Disabled')
|
76
|
-
})
|
77
|
-
|
78
|
-
it('.parent() - get parent DOM element from DOM elements', () => {
|
79
|
-
// https://on.cypress.io/parent
|
80
|
-
cy.get('.traversal-mark')
|
81
|
-
.parent().should('contain', 'Morbi leo risus')
|
82
|
-
})
|
83
|
-
|
84
|
-
it('.parents() - get parent DOM elements from DOM elements', () => {
|
85
|
-
// https://on.cypress.io/parents
|
86
|
-
cy.get('.traversal-cite')
|
87
|
-
.parents().should('match', 'blockquote')
|
88
|
-
})
|
89
|
-
|
90
|
-
it('.parentsUntil() - get parent DOM elements from DOM elements until el', () => {
|
91
|
-
// https://on.cypress.io/parentsuntil
|
92
|
-
cy.get('.clothes-nav')
|
93
|
-
.find('.active')
|
94
|
-
.parentsUntil('.clothes-nav')
|
95
|
-
.should('have.length', 2)
|
96
|
-
})
|
97
|
-
|
98
|
-
it('.prev() - get previous sibling DOM element', () => {
|
99
|
-
// https://on.cypress.io/prev
|
100
|
-
cy.get('.birds').find('.active')
|
101
|
-
.prev().should('contain', 'Lorikeets')
|
102
|
-
})
|
103
|
-
|
104
|
-
it('.prevAll() - get all previous sibling DOM elements', () => {
|
105
|
-
// https://on.cypress.io/prevAll
|
106
|
-
cy.get('.fruits-list').find('.third')
|
107
|
-
.prevAll().should('have.length', 2)
|
108
|
-
})
|
109
|
-
|
110
|
-
it('.prevUntil() - get all previous sibling DOM elements until el', () => {
|
111
|
-
// https://on.cypress.io/prevUntil
|
112
|
-
cy.get('.foods-list').find('#nuts')
|
113
|
-
.prevUntil('#veggies').should('have.length', 3)
|
114
|
-
})
|
115
|
-
|
116
|
-
it('.siblings() - get all sibling DOM elements', () => {
|
117
|
-
// https://on.cypress.io/siblings
|
118
|
-
cy.get('.traversal-pills .active')
|
119
|
-
.siblings().should('have.length', 2)
|
120
|
-
})
|
121
|
-
})
|
data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/utilities.spec.js
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
/// <reference types="Cypress" />
|
2
|
-
|
3
|
-
context('Utilities', () => {
|
4
|
-
beforeEach(() => {
|
5
|
-
cy.visit('https://example.cypress.io/utilities')
|
6
|
-
})
|
7
|
-
|
8
|
-
it('Cypress._ - call a lodash method', () => {
|
9
|
-
// https://on.cypress.io/_
|
10
|
-
cy.request('https://jsonplaceholder.typicode.com/users')
|
11
|
-
.then((response) => {
|
12
|
-
let ids = Cypress._.chain(response.body).map('id').take(3).value()
|
13
|
-
|
14
|
-
expect(ids).to.deep.eq([1, 2, 3])
|
15
|
-
})
|
16
|
-
})
|
17
|
-
|
18
|
-
it('Cypress.$ - call a jQuery method', () => {
|
19
|
-
// https://on.cypress.io/$
|
20
|
-
let $li = Cypress.$('.utility-jquery li:first')
|
21
|
-
|
22
|
-
cy.wrap($li)
|
23
|
-
.should('not.have.class', 'active')
|
24
|
-
.click()
|
25
|
-
.should('have.class', 'active')
|
26
|
-
})
|
27
|
-
|
28
|
-
it('Cypress.Blob - blob utilities and base64 string conversion', () => {
|
29
|
-
// https://on.cypress.io/blob
|
30
|
-
cy.get('.utility-blob').then(($div) =>
|
31
|
-
// https://github.com/nolanlawson/blob-util#imgSrcToDataURL
|
32
|
-
// get the dataUrl string for the javascript-logo
|
33
|
-
Cypress.Blob.imgSrcToDataURL('https://example.cypress.io/assets/img/javascript-logo.png', undefined, 'anonymous')
|
34
|
-
.then((dataUrl) => {
|
35
|
-
// create an <img> element and set its src to the dataUrl
|
36
|
-
let img = Cypress.$('<img />', { src: dataUrl })
|
37
|
-
// need to explicitly return cy here since we are initially returning
|
38
|
-
// the Cypress.Blob.imgSrcToDataURL promise to our test
|
39
|
-
// append the image
|
40
|
-
$div.append(img)
|
41
|
-
|
42
|
-
cy.get('.utility-blob img').click()
|
43
|
-
.should('have.attr', 'src', dataUrl)
|
44
|
-
}))
|
45
|
-
})
|
46
|
-
|
47
|
-
it('Cypress.minimatch - test out glob patterns against strings', () => {
|
48
|
-
// https://on.cypress.io/minimatch
|
49
|
-
Cypress.minimatch('/users/1/comments', '/users/*/comments', {
|
50
|
-
matchBase: true,
|
51
|
-
})
|
52
|
-
})
|
53
|
-
|
54
|
-
|
55
|
-
it('Cypress.moment() - format or parse dates using a moment method', () => {
|
56
|
-
// https://on.cypress.io/moment
|
57
|
-
let time = Cypress.moment().utc('2014-04-25T19:38:53.196Z').format('h:mm A')
|
58
|
-
|
59
|
-
cy.get('.utility-moment').contains('3:38 PM')
|
60
|
-
.should('have.class', 'badge')
|
61
|
-
})
|
62
|
-
|
63
|
-
|
64
|
-
it('Cypress.Promise - instantiate a bluebird promise', () => {
|
65
|
-
// https://on.cypress.io/promise
|
66
|
-
let waited = false
|
67
|
-
|
68
|
-
function waitOneSecond () {
|
69
|
-
// return a promise that resolves after 1 second
|
70
|
-
return new Cypress.Promise((resolve, reject) => {
|
71
|
-
setTimeout(() => {
|
72
|
-
// set waited to true
|
73
|
-
waited = true
|
74
|
-
|
75
|
-
// resolve with 'foo' string
|
76
|
-
resolve('foo')
|
77
|
-
}, 1000)
|
78
|
-
})
|
79
|
-
}
|
80
|
-
|
81
|
-
cy.then(() =>
|
82
|
-
// return a promise to cy.then() that
|
83
|
-
// is awaited until it resolves
|
84
|
-
waitOneSecond().then((str) => {
|
85
|
-
expect(str).to.eq('foo')
|
86
|
-
expect(waited).to.be.true
|
87
|
-
}))
|
88
|
-
})
|
89
|
-
})
|
data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/viewport.spec.js
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
/// <reference types="Cypress" />
|
2
|
-
|
3
|
-
context('Viewport', () => {
|
4
|
-
beforeEach(() => {
|
5
|
-
cy.visit('https://example.cypress.io/commands/viewport')
|
6
|
-
})
|
7
|
-
|
8
|
-
it('cy.viewport() - set the viewport size and dimension', () => {
|
9
|
-
// https://on.cypress.io/viewport
|
10
|
-
|
11
|
-
cy.get('#navbar').should('be.visible')
|
12
|
-
cy.viewport(320, 480)
|
13
|
-
|
14
|
-
// the navbar should have collapse since our screen is smaller
|
15
|
-
cy.get('#navbar').should('not.be.visible')
|
16
|
-
cy.get('.navbar-toggle').should('be.visible').click()
|
17
|
-
cy.get('.nav').find('a').should('be.visible')
|
18
|
-
|
19
|
-
// lets see what our app looks like on a super large screen
|
20
|
-
cy.viewport(2999, 2999)
|
21
|
-
|
22
|
-
// cy.viewport() accepts a set of preset sizes
|
23
|
-
// to easily set the screen to a device's width and height
|
24
|
-
|
25
|
-
// We added a cy.wait() between each viewport change so you can see
|
26
|
-
// the change otherwise it is a little too fast to see :)
|
27
|
-
|
28
|
-
cy.viewport('macbook-15')
|
29
|
-
cy.wait(200)
|
30
|
-
cy.viewport('macbook-13')
|
31
|
-
cy.wait(200)
|
32
|
-
cy.viewport('macbook-11')
|
33
|
-
cy.wait(200)
|
34
|
-
cy.viewport('ipad-2')
|
35
|
-
cy.wait(200)
|
36
|
-
cy.viewport('ipad-mini')
|
37
|
-
cy.wait(200)
|
38
|
-
cy.viewport('iphone-6+')
|
39
|
-
cy.wait(200)
|
40
|
-
cy.viewport('iphone-6')
|
41
|
-
cy.wait(200)
|
42
|
-
cy.viewport('iphone-5')
|
43
|
-
cy.wait(200)
|
44
|
-
cy.viewport('iphone-4')
|
45
|
-
cy.wait(200)
|
46
|
-
cy.viewport('iphone-3')
|
47
|
-
cy.wait(200)
|
48
|
-
|
49
|
-
// cy.viewport() accepts an orientation for all presets
|
50
|
-
// the default orientation is 'portrait'
|
51
|
-
cy.viewport('ipad-2', 'portrait')
|
52
|
-
cy.wait(200)
|
53
|
-
cy.viewport('iphone-4', 'landscape')
|
54
|
-
cy.wait(200)
|
55
|
-
|
56
|
-
// The viewport will be reset back to the default dimensions
|
57
|
-
// in between tests (the default can be set in cypress.json)
|
58
|
-
})
|
59
|
-
})
|
data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/waiting.spec.js
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
/// <reference types="Cypress" />
|
2
|
-
|
3
|
-
context('Waiting', () => {
|
4
|
-
beforeEach(() => {
|
5
|
-
cy.visit('https://example.cypress.io/commands/waiting')
|
6
|
-
})
|
7
|
-
// BE CAREFUL of adding unnecessary wait times.
|
8
|
-
// https://on.cypress.io/best-practices#Unnecessary-Waiting
|
9
|
-
|
10
|
-
// https://on.cypress.io/wait
|
11
|
-
it('cy.wait() - wait for a specific amount of time', () => {
|
12
|
-
cy.get('.wait-input1').type('Wait 1000ms after typing')
|
13
|
-
cy.wait(1000)
|
14
|
-
cy.get('.wait-input2').type('Wait 1000ms after typing')
|
15
|
-
cy.wait(1000)
|
16
|
-
cy.get('.wait-input3').type('Wait 1000ms after typing')
|
17
|
-
cy.wait(1000)
|
18
|
-
})
|
19
|
-
|
20
|
-
it('cy.wait() - wait for a specific route', () => {
|
21
|
-
cy.server()
|
22
|
-
|
23
|
-
// Listen to GET to comments/1
|
24
|
-
cy.route('GET', 'comments/*').as('getComment')
|
25
|
-
|
26
|
-
// we have code that gets a comment when
|
27
|
-
// the button is clicked in scripts.js
|
28
|
-
cy.get('.network-btn').click()
|
29
|
-
|
30
|
-
// wait for GET comments/1
|
31
|
-
cy.wait('@getComment').its('status').should('eq', 200)
|
32
|
-
})
|
33
|
-
|
34
|
-
})
|
data/lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/window.spec.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
/// <reference types="Cypress" />
|
2
|
-
|
3
|
-
context('Window', () => {
|
4
|
-
beforeEach(() => {
|
5
|
-
cy.visit('https://example.cypress.io/commands/window')
|
6
|
-
})
|
7
|
-
|
8
|
-
it('cy.window() - get the global window object', () => {
|
9
|
-
// https://on.cypress.io/window
|
10
|
-
cy.window().should('have.property', 'top')
|
11
|
-
})
|
12
|
-
|
13
|
-
it('cy.document() - get the document object', () => {
|
14
|
-
// https://on.cypress.io/document
|
15
|
-
cy.document().should('have.property', 'charset').and('eq', 'UTF-8')
|
16
|
-
})
|
17
|
-
|
18
|
-
it('cy.title() - get the title', () => {
|
19
|
-
// https://on.cypress.io/title
|
20
|
-
cy.title().should('include', 'Kitchen Sink')
|
21
|
-
})
|
22
|
-
})
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/filter_parameter_logging.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/data/{spec/integrations → specs_e2e}/rails_4_2/config/initializers/to_time_preserves_timezone.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|