New Test Application Overview | Bondar Academy
Course: Mastering testRigor
Module: Working with APIs
Instructor: Artem Bondar
Lesson Summary
This lesson introduces a new test application with a backend API that allows for a fully functional client-server interaction. The application, accessible at conduit.bonderacademy.com , enables users to perform various API activities. Getting Started To begin, users must create an account: Click on the sign up link in the top right corner. Enter a random email and password to create a unique account. For example, a user can register as test rigor [email protected] with the password welcome . Core Functionality Once logged in, users can: Create articles by entering a title, description, body, and tags. Edit or delete articles. View a list of created articles on the main page. All actions trigger requests to the API, updating records in the database. Network Activity To monitor API calls: Right-click and select Inspect . Navigate to the Network tab and filter by fetch and XHR . Refresh the page to view all API requests. Key endpoints include: /API/user - Retrieves user information. /articles - Lists articles with parameters for pagination. /API/tags - Provides a list of tags used in articles. Test Suite Setup To practice API activities, set up a new test suite in Test Trigger: Name the suite (e.g., conduit QA ). Use the previously created credentials for login. Initial tests should focus on logging into the application, ensuring that users can perform operations after authentication. In conclusion, the project in Test Trigger is now configured, and users are prepared to proceed with further lessons.
Video Transcript
In this section, I will make the introduction to the new test application that we're going to use in this section. So this new test application has a backend API, so fully functional client-server application. And on this new application, we're going to practice some of those API activities that I have mentioned in the previous presentation. So let's get into it. So open your browser and navigate to conduit.bonderacademy.com. So this is the application that we're going to use for this class. And when you open it as a user, so there is not much you can do over here. So you can basically just open the articles, read the articles, and just go back, and that's pretty much it. So the core functionality of the app is when you create your own account and log in as authorized user. So this is the first thing that you need to do. Here in the top right corner, click on sign up link, and you need to create your own account. And it can be any random email and password. It does not necessarily have to be the real email or password. So create your own unique account that you're going to use just for this class. So let me create, for example, new user as test rigor user, for example. And I create some email as test rigor user at test.com, something like this, and any password. For example, welcome, and click sign up. And here we go, new user is created. And now when account is created, you can create, for example, new articles. So click on the article, create article title. This is a title. This is short description, and this is body of the article. This is a body of the article. And you can add some text, for example, test tag one, something like this, and publish the article. And now article is created. You can now edit article, delete the article, or if you navigate to main page, now you can see the article in the list of the created articles. Now you can go and open this article again. Click delete, and article is deleted. So when you perform all those operations, our applications send requests to the API and update those records in the database. So application interacts with the backend. Let me show you in the networking tab, how does it look. So right click inspect over here, then navigate to the network tab. And on the network tab, select this filter, fetch and XHR instead of all by default. So fetch and XHR will filter for you all networking requests that your browser performs during the flow of the application. And now I just click refresh. And in this networking tab, you can see all API calls that were performed by the application during the refresh. So let's review them one by one. So first endpoint is user. And I click on the headers over here, and here we go. The request URL was conduit-api-bonderacademy.com slash API slash user. It was a GET type of the request. Status code was 200. And click on the response. You can see the response object that came back from the API. We can see just user ID, email, user name and token for this user. So let's check the second one. So articles. The URL was articles with two parameters, limit 10 and offset. It was also a GET call with status 200. And the response was the list of the article that we see on the main page. So here's the articles array. This is the first article. This is the second article and so on. You can see the object with the data. Title of the article, description, body, tag list of the article, when it's created and so on. And let's check the third one is the tags endpoint. Here we go. The endpoint was API tags. It was also GET call. Response was 200. And the response object was this one. And if you look into the top right corner over here, you can see that the list of the tags in the response object is exactly the same list as displayed over here in the page. So this is how web application works. It sends requests to the API. API provides the response with just a raw data. And then browser transforms this data into the nice UI view of representing this data on the page. So in this lesson, we will practice with those articles, creating articles, deleting the articles, mocking the articles, and so on. And we will practice those APIs activity. So let's set up a new test suite for this test application. Going back to the test trigger. And I create a new test suite. For example, I call it conduit. Let's call it QA. I don't think that we're going to create the clone of this one, but let's call it like this. The next step, we need to provide URL. URL is this one. And let me use the credentials that we created before. So I will use predefined variables later on in my script with those credentials. So the username is the email that we created. Test trigger user at test.com. And password was welcome. Okay. Ubuntu, Chrome, I will put zero over here and create test suite. All right. Test suite created. And now let's create a first test. For example, just to log into our application. Because in order to perform any operations here, we have to be logged in. So let me log out first. And I create a new test case. And let's call it log in. First step is to click on sign in to the right of home. And let's do this. Click sign in to the right of home. Okay. The next step, click sign in. Then we need to type email and password in email and password field. Enter stored value. I will use predefined variable. Username into, what is it, email. Into email. And enter stored value into password, into password. And then last step, we need to click on sign in. But look, we have several sign ins here. We have sign in link over here. We have sign in text over here. And we have sign in button over here. So let's click on sign in below password. And in this case, we will guarantee that we're going to click on this particular button. Click button. Sign in below password. And after this step, let's make a validation that after we perform a sign in, this URL should be on the home page. So this URL have to be displayed in the browser. Check that URL is equals to this one. All right. I believe that's it. Let's quickly run to see if this is working. All right. Let's check it out. We're logged in successfully. And the last step, just to refactor it immediately, let me create a reusable rule based on those steps. And we're going to use this reusable rule in other tests because for other tests, we also will need to sign in to this application. So the reusable rule for these steps is a good candidate. I go to reusable rules. Create a new rule. Login to application. Login page. Paste those steps. Save and find. Replace selected. Gone back to test cases. View the steps. And the step was replaced with a new reusable rule. All right. That's it, guys. The new project in Test Trigger is configured, and we're ready to move forward. See you in the next lesson.