Difference between revisions of "Testing Your Site"
Jump to navigation
Jump to search
Riley.McCuen (talk | contribs) (Needs more work, specific JSON keys and values need to be described and examples provided) |
|||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
| − | After you have finished building your site and testing it locally you should always test | + | After you have finished building your site and testing it locally you should always test it using Amazon's MTurk Sandbox. |
| − | The MTurk Sandbox is essentially the | + | The MTurk Sandbox is essentially a clone of the environment that MTurk workers use, except it is explicitly for requesters to test their HITs. |
When you submit to the sandbox and and accept the HIT you get to see how your HIT will actually look to the workers who will eventually do your hit. | When you submit to the sandbox and and accept the HIT you get to see how your HIT will actually look to the workers who will eventually do your hit. | ||
Now that you have a little bit better understanding of what testing on the MTurk Sandbox means, here is how to do it: | Now that you have a little bit better understanding of what testing on the MTurk Sandbox means, here is how to do it: | ||
| − | + | <ol> | |
| − | + | <li> You will need to set up a credentials file that will be used by a javascript script in your repository to submit your HIT. </li> | |
| − | + | <ol> | |
| − | + | <li> Create a JSON file at the highest level of your repository named aws-credentials.json. For example if your repository was named information-foraging-foo.bar then your file should be located at information-foraging-foo.bar/aws-credentials.json. </li> | |
| − | + | <li> Now copy and paste the code below into that file: | |
| − | + | <pre> | |
| − | + | { | |
| − | + | "accessKeyId": "your access key id here", | |
| − | + | "secretAccessKey": "your secret access key here", | |
| − | + | "region": "us-east-1", | |
| − | + | "endpoint": "https://mturk-requester-sandbox.us-east-1.amazonaws.com" | |
| − | + | } | |
| − | + | </pre> | |
| − | + | </li> | |
| − | + | <li> Now that you have that code in the file, replace the part that says 'your access key id here' with the AWS Access ID that you set up earlier and do the same thing for the part that says 'your secret access key here'. Your file should now look like: | |
| − | + | <pre> | |
| − | + | { | |
| − | + | "accessKeyId": "ABCDEFGHIJ12345LMN10", | |
| − | + | "secretAccessKey": "rp92mk719cIjFAJFIEFDqyBlPhAxBvhjatO0lJEp", | |
| − | + | "region": "us-east-1", | |
| − | + | "endpoint": "https://mturk-requester-sandbox.us-east-1.amazonaws.com" | |
| − | + | } | |
| − | + | </pre> | |
| + | </li> | ||
| + | </ol> | ||
| + | <li> Now that you have set up your aws-credentials.json file there is one more configuration step that you need to take care of. You must put your websites home page url into your projects package.json file. You can see the package.json file is also at the top level of your repository. </li> | ||
| + | <ol> | ||
| + | <li> Open up package.json and look for the key: "url". It should look something like this: | ||
| + | <pre> | ||
| + | { | ||
| + | "name": "information-foraging", | ||
| + | ... more json fields here -- do not touch them please ... | ||
| + | "url": "put your repository's home page url here", | ||
| + | ... more json fields here -- do not touch them please ... | ||
| + | } | ||
| + | </pre> | ||
| + | </li> | ||
| + | <li> Replace the value ("put your repository's home page url here") of that attribute with the url that points to your project's Github pages homepage. Your package.json should now look something like this: | ||
| + | <pre> | ||
| + | { | ||
| + | "name": "information-foraging", | ||
| + | ... more json fields here -- do not touch them please ... | ||
| + | "url": "https://cse256-sp2021.github.io/information-foraging/", | ||
| + | ... more json fields here -- do not touch them please ... | ||
| + | } | ||
| + | </pre> | ||
| + | </li> | ||
| + | </ol> | ||
| + | <li> Now that you have configured your project you can go ahead and submit a hit. Open a terminal and run this command: 'npm run sandbox'. </li> | ||
| + | <ol> | ||
| + | <li> That command will send a HIT to the MTurk sandbox on your behalf. Now log into the MTurk Sandbox Worker site and you should see a big list of HITs. </li> | ||
| + | <li> If you sort the HITs by the time that they were created you should eventually see your HIT come up. Be patient as it can take about a minute to be published. </li> | ||
| + | <li> You will know it is your hit because the requester listed on the far left side will be your MTurk requester account username. </li> | ||
| + | <li> Select accept and work for your HIT and then you can complete a HIT based on your website. </li> | ||
| + | </ol> | ||
| + | </ol> | ||
Latest revision as of 16:58, 4 August 2022
After you have finished building your site and testing it locally you should always test it using Amazon's MTurk Sandbox. The MTurk Sandbox is essentially a clone of the environment that MTurk workers use, except it is explicitly for requesters to test their HITs. When you submit to the sandbox and and accept the HIT you get to see how your HIT will actually look to the workers who will eventually do your hit. Now that you have a little bit better understanding of what testing on the MTurk Sandbox means, here is how to do it:
- You will need to set up a credentials file that will be used by a javascript script in your repository to submit your HIT.
- Create a JSON file at the highest level of your repository named aws-credentials.json. For example if your repository was named information-foraging-foo.bar then your file should be located at information-foraging-foo.bar/aws-credentials.json.
- Now copy and paste the code below into that file:
{ "accessKeyId": "your access key id here", "secretAccessKey": "your secret access key here", "region": "us-east-1", "endpoint": "https://mturk-requester-sandbox.us-east-1.amazonaws.com" } - Now that you have that code in the file, replace the part that says 'your access key id here' with the AWS Access ID that you set up earlier and do the same thing for the part that says 'your secret access key here'. Your file should now look like:
{ "accessKeyId": "ABCDEFGHIJ12345LMN10", "secretAccessKey": "rp92mk719cIjFAJFIEFDqyBlPhAxBvhjatO0lJEp", "region": "us-east-1", "endpoint": "https://mturk-requester-sandbox.us-east-1.amazonaws.com" } - Now that you have set up your aws-credentials.json file there is one more configuration step that you need to take care of. You must put your websites home page url into your projects package.json file. You can see the package.json file is also at the top level of your repository.
- Open up package.json and look for the key: "url". It should look something like this:
{ "name": "information-foraging", ... more json fields here -- do not touch them please ... "url": "put your repository's home page url here", ... more json fields here -- do not touch them please ... } - Replace the value ("put your repository's home page url here") of that attribute with the url that points to your project's Github pages homepage. Your package.json should now look something like this:
{ "name": "information-foraging", ... more json fields here -- do not touch them please ... "url": "https://cse256-sp2021.github.io/information-foraging/", ... more json fields here -- do not touch them please ... } - Now that you have configured your project you can go ahead and submit a hit. Open a terminal and run this command: 'npm run sandbox'.
- That command will send a HIT to the MTurk sandbox on your behalf. Now log into the MTurk Sandbox Worker site and you should see a big list of HITs.
- If you sort the HITs by the time that they were created you should eventually see your HIT come up. Be patient as it can take about a minute to be published.
- You will know it is your hit because the requester listed on the far left side will be your MTurk requester account username.
- Select accept and work for your HIT and then you can complete a HIT based on your website.