Skip to Content

DVA-C02: How to Add End-to-End Testing to AWS Amplify Hosting Application

Learn how to use AWS Amplify Console’s built-in testing feature to add end-to-end testing to your application hosted on AWS Amplify Hosting. Find out how to configure and run tests using Cypress, a popular testing framework.

Table of Contents

Question

A developer is using AWS Amplify Hosting to build and deploy an application. The developer is receiving an increased number of bug reports from users. The developer wants to add end-to-end testing to the application to eliminate as many bugs as possible before the bugs reach production.

Which solution should the developer implement to meet these requirements?

A. Run the amplify add test command in the Amplify CLI.
B. Create unit tests in the application. Deploy the unit tests by using the amplify push command in the Amplify CLI.
C. Add a test phase to the amplify.yml build settings for the application.
D. Add a test phase to the aws-exports.js file for the application.

Answer

C. Add a test phase to the amplify.yml build settings for the application.

Explanation

The correct answer is C. Add a test phase to the amplify.yml build settings for the application.

This solution will meet the requirements because it will allow the developer to add end-to-end testing to the application and run the tests as part of the AWS Amplify Hosting build process. The amplify.yml file is a configuration file that defines how AWS Amplify Hosting builds and deploys the application. The developer can add a test phase to the amplify.yml file and specify the commands and settings for running the end-to-end tests. The test phase will run after the build phase and before the deploy phase. If the test phase fails, the deploy phase will not run and the application will not be deployed to production.

The other options are not optimal because:

  • Option A: Running the amplify add test command in the Amplify CLI will not work, as there is no such command in the Amplify CLI. The Amplify CLI is a tool that helps developers create, configure, and manage AWS resources for their applications. However, it does not provide a command for adding end-to-end testing to the application.
  • Option B: Creating unit tests in the application and deploying them by using the amplify push command in the Amplify CLI will not meet the requirements, as unit tests are not sufficient for eliminating as many bugs as possible before they reach production. Unit tests are used to test individual components or functions of the application, but they do not test how the application works as a whole or how it interacts with external services or user interfaces. End-to-end tests are used to test the entire application from start to finish, simulating real user scenarios and workflows.
  • Option D: Adding a test phase to the aws-exports.js file for the application will not work, as the aws-exports.js file is not a configuration file for AWS Amplify Hosting. The aws-exports.js file is a file that contains information about the AWS resources that are used by the application, such as API endpoints, authentication settings, and storage buckets. The aws-exports.js file is generated by the Amplify CLI when creating or updating AWS resources for the application. It is not used to define how AWS Amplify Hosting builds and deploys the application.

Therefore, option C is the best solution for adding end-to-end testing to the application.

The latest AWS Certified Developer – Associate DVA-C02 certification actual real practice exam question and answer (Q&A) dumps are available free, which are helpful for you to pass the AWS Certified Developer – Associate DVA-C02 exam and earn AWS Certified Developer – Associate DVA-C02 certification.

AWS Certified Developer - Associate DVA-C02 Exam Questions and Answers