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

#1203 return status code from goto #1215

Merged
merged 9 commits into from
Apr 30, 2020
Merged

Conversation

NivedhaSenthil
Copy link
Member

Signed-off-by: NivedhaSenthil nivedhasenthil@gmail.com
Fixes #1203

Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
@gaugebot gaugebot bot requested a review from BugDiver April 23, 2020 11:26
@zabil
Copy link
Member

zabil commented Apr 23, 2020

I think this should wrapped in a json string for example.

response = goto("google.com")
if(!response.ok) { // boolean, true for 200 and false for rest, must handle redirects
 console.log(response.status)
}

Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
@NivedhaSenthil
Copy link
Member Author

> goto("gauge.org/")
 value: {
  redirectedResponse: [
    {
      url: 'http://gauge.org/',
      status: 301,
      statusText: 'Moved Permanently'
    }
  ],
  url: 'https://gauge.org/',
  status: 200,
  statusText: ''
}

sample response looks like above

@zabil
Copy link
Member

zabil commented Apr 27, 2020

Can you please make this

> goto("gauge.org/")
 value: {
  redirectedResponse: [
    {
      url: 'http://gauge.org/',
      status : { code: 301,
                    text: 'Moved Permanently'
                 }
    }
  ],
  url: 'https://gauge.org/',
  status: { code: 200,
                  text: ''
               }
}

Are the url's going to be the same (in the example http://gauge.org) even if it's been redirected for example from taiko.gauge.org -> 'taiko.dev'

Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
@NivedhaSenthil
Copy link
Member Author

Response for taiko.gauge.org

> goto("taiko.gauge.org")
 value: {
  redirectedResponse: [
    {
      url: 'http://taiko.gauge.org/',
      status: { code: 301, text: 'Moved Permanently' }
    },
    {
      url: 'https://taiko.gauge.org/',
      status: { code: 301, text: '' }
    },
    {
      url: 'http://taiko.dev/',
      status: { code: 307, text: 'Internal Redirect' }
    }
  ],
  url: 'https://taiko.dev/',
  status: { code: 200, text: '' }
}

@zabil zabil added the feature label Apr 28, 2020
@zabil
Copy link
Member

zabil commented Apr 28, 2020

Can we also update the documentation for the goto api. Preferably an example showing the usage.

@gaugebot
Copy link

gaugebot bot commented Apr 28, 2020

@NivedhaSenthil Thank you for contributing to taiko. Your pull request has been labeled as a release candidate 🎉🎉.

Merging this PR will trigger a release.

Please bump up the version as part of this PR.

Instructions to bump the version can found at CONTRIBUTING.md

If the CONTRIBUTING.md file does not exist or does not include instructions about bumping up the version, please looks previous commits in git history to see what changes need to be done.

Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
@NivedhaSenthil
Copy link
Member Author

updated docs 👍

Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
@getgauge getgauge deleted a comment from gaugebot bot Apr 28, 2020
@NivedhaSenthil NivedhaSenthil merged commit ed25434 into master Apr 30, 2020
@NivedhaSenthil NivedhaSenthil deleted the goto_return_status_code branch April 30, 2020 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Capability to retrieve status code from Goto()
3 participants