Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register Capypara actions for alert and confirm methods #103

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gazayas
Copy link

@gazayas gazayas commented Jul 10, 2023

Closes #54.

This will add accept_alert to a test like this:

require "application_system_test_case"

class BasicsTest < ApplicationSystemTestCase
  test "getting started" do
    visit root_path
  
    click_on 'Link to Alert'
    accept_alert
  end
end

We could probably do this with a block if we wanted to, but it would definitely take more work and I at least wanted to just make sure we could register alerts that were accepted when flushing the input.

@gazayas
Copy link
Author

gazayas commented Jul 11, 2023

I'm afraid this might get in the way of generating assertions with Ctrl + Shift + A.

@gazayas
Copy link
Author

gazayas commented Jul 11, 2023

I'm afraid this might get in the way of generating assertions with Ctrl + Shift + A.

Alright, I was able to fix it.

@gazayas
Copy link
Author

gazayas commented Jul 11, 2023

If we wanted to write blocks, I'm thinking with our current set up we'd have to write something like this, which I'm not a fan of:

testingOutput.push({action: "accept_alert do", target: "", options: ""});

// Register all of the actions for accept_alert...

// Then close off the block
testingOutput.push({action: "end", target: "", options: ""});

We could also write directly to the file above the magic_test invocation, but again I think I'll just leave this one be unless we really need it or its requested for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log accept alert
1 participant