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

Have a better way of doing testing #14

Open
sjmog opened this issue Mar 9, 2018 · 1 comment
Open

Have a better way of doing testing #14

sjmog opened this issue Mar 9, 2018 · 1 comment

Comments

@sjmog
Copy link
Owner

sjmog commented Mar 9, 2018

This should probably be based off Ralyxa, rather than core. But it'd be nice to have some command-line-runnable tests that can go ask the AVS if they got the right result (or you'd stub the correct response).

describe 'Saying hello' do
  it 'Alexa responds with "yo, sup"' do
    response = Ralyxa.invokeIntent('HelloWorldIntent')
    expect(response.speech).to eq "yo, sup"
  end
end
@sarkonovich
Copy link

sarkonovich commented Mar 16, 2018

This is not based off Ralyxa, but for what it's worth, here's my Ruby-based testing framework. It uses SMAPI, and handles getting/refreshing of tokens. It implements the skill-simulate and skill-invoke commands.

The syntax would look like this:

results = SayHelloSkill.test(output: "result")
let(:simulation) { ResponseObject.new(results) }

describe 'saying hello' do
    it 'Alexa responds with "yo, sup"'  do
      expect(simulation.response_body.response.outputSpeech.text).to eq "yo, sup"
    end

    it 'invokes Launch Request'  do
      expect(simulation.request_body.request.type).to eq "LaunchRequest"
    end
  end

https://github.com/sarkonovich/Alexa-SMAPI-Tester

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

No branches or pull requests

2 participants