<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Eleonora Belova  on Medium]]></title>
        <description><![CDATA[Stories by Eleonora Belova  on Medium]]></description>
        <link>https://medium.com/@qa-nora?source=rss-5b22734b1e50------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6aFW_uhDYGVtaM47cbCQOQ.jpeg</url>
            <title>Stories by Eleonora Belova  on Medium</title>
            <link>https://medium.com/@qa-nora?source=rss-5b22734b1e50------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 21:02:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@qa-nora/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to parameterize projects in Playwright]]></title>
            <link>https://qa-nora.medium.com/how-to-parameterize-projects-in-playwright-82da3b8a1baf?source=rss-5b22734b1e50------2</link>
            <guid isPermaLink="false">https://medium.com/p/82da3b8a1baf</guid>
            <category><![CDATA[playwright-automation]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Eleonora Belova ]]></dc:creator>
            <pubDate>Thu, 01 Feb 2024 06:33:02 GMT</pubDate>
            <atom:updated>2024-02-01T06:33:02.944Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oR2Ng8sjrGkAeqM2BDVWEQ.png" /></figure><p>Today, I encountered an interesting challenge while working on a Playwright project at work, and I’d like to document my findings.</p><blockquote><strong><em>The task was to simultaneously run multiple projects, each with different sets of data.</em></strong></blockquote><p>Thankfully, Playwright offers a feature to address this requirement — the ability to declare <strong><em>options</em></strong>.</p><p>In this article, I’ll walk you through the process of leveraging Playwright’s option declaration feature to efficiently manage and execute multiple projects concurrently.</p><blockquote>Explore the demo-project’s code snippets on my GitHub repository: <a href="https://github.com/nora-weisser/playwright_demo">https://github.com/nora-weisser/playwright_demo</a></blockquote><p><strong>Step 1</strong>: Install the project:</p><pre>npm init playwright@latest</pre><p>Playwright will download all needed browsers and create the following structure of the project:</p><pre>playwright.config.ts<br>package.json<br>package-lock.json<br>tests/<br>  example.spec.ts<br>test-examples/<br>  test.examples.ts</pre><p><strong>Step 2</strong>. Add configuration for Playwright Project.</p><p>Navigate to playwright.config.ts. This file serves as the central hub for Playwright configurations, allowing you to set up settings such as preferred browsers for your Playwright tests. Within the configuration, locate the &#39;use&#39; section and set the base URL. In this demonstration, I&#39;ve chosen &#39;<a href="https://www.saucedemo.com/">https://www.saucedemo.com/</a>&#39; as the base URL for demo purposes.</p><pre>use: {<br>    /* Base URL to use in actions like `await page.goto(&#39;/&#39;)`. */<br>    baseURL: &#39;https://www.saucedemo.com/&#39;,<br>    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */<br>    trace: &#39;on-first-retry&#39;,<br> },</pre><p><strong>Step 3</strong>. Scrolling down within the file, you’ll encounter various projects. I’ve included a definition from the Playwright documentation below for your reference:</p><blockquote>A Project is logical group of tests running with the same configuration. We use projects so we can run tests on different browsers and devices. Projects are configured in the playwright.config.ts file and once configured you can then run your tests on all projects or only on a specific project. You can also use projects to run the same tests in different configurations. For example, you can run the same tests in a logged-in and logged-out state.</blockquote><p><strong>Step 4</strong>. Outline a specific test scenario.</p><p><strong>Test case</strong>: implement a login test case and execute it with various sets of data</p><p>The parameterization feature plays a crucial role here, enabling the configuration of each project to run the test case against different username/password pairs.</p><p><strong>Step 5</strong>. Let’s take a look at data.</p><p>Test Data is listed on login screen for testing purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2RzF1FFuHfqIEiAmNRNJ7Q.png" /></figure><p><strong>Step 6</strong>. Create Test Data</p><p>Establish a ‘test_data’ folder, and within it, create ‘login.data.ts.’ Begin by declaring an interface that encapsulates the necessary properties (username and password) along with their data types.</p><pre>export interface USER_DATA {<br>    username: string,<br>    password: string<br>}</pre><p>Introduce a variable USERS and list all test users designed for the testing purposes.</p><pre>export const USERS: {[type: string]: USER_DATA} = {<br>    &quot;standard_user&quot;: {<br>        username: &quot;standard_user&quot;,<br>        password: &quot;secret_sauce&quot;<br>    },<br>    &quot;locked_out_user&quot;: {<br>        username: &quot;locked_out_user&quot;,<br>        password: &quot;secret_sauce&quot;<br>    },<br>    &quot;problem_user&quot;: {<br>        username: &quot;problem_user&quot;,<br>        password: &quot;secret_sauce&quot;<br>    },<br>    &quot;performance_glitch_user&quot;: {<br>        username: &quot;performance_glitch_user&quot;,<br>        password: &quot;secret_sauce&quot;<br>    },<br>    &quot;error_user&quot;: {<br>        username: &quot;error_user&quot;,<br>        password: &quot;secret_sauce&quot;<br>    },<br>    &quot;visual_user&quot;: {<br>        username: &quot;visual_user&quot;,<br>        password: &quot;secret_sauce&quot;<br>    }<br>}</pre><p><strong>Step 7</strong>. In order to incorporate the ‘user’ parameter into both the test case and project, it’s essential to declare the option ‘targetUser’ and set its value in the configuration. Create a ‘helper’ folder and within it, establish ‘test-option.ts.’</p><p>Extend the existing ‘TestOptions’ by introducing a new option, ‘targetUser,’ to facilitate the integration of user parameters.”</p><pre>import { test as base } from &#39;@playwright/test&#39;<br>import { USER_DATA } from &#39;../test_data/login.data&#39;<br>import { USERS } from &#39;../test_data/login.data&#39;<br><br>export interface TestOptions {<br>    targetUser: USER_DATA<br>}<br>export const test = base.extend&lt;TestOptions&gt;({<br>    targetUser: [USERS[&#39;standard_user&#39;], { option: true }],<br>})</pre><p><strong>Step 8</strong>. We can use option in the test.</p><pre>import { expect } from &#39;@playwright/test&#39;;<br>import {test} from &#39;../helpers/test-options&#39;<br><br>test(&#39;login with existing username and valid password&#39;, async ({ page, targetUser }) =&gt; {<br>  await page.goto(&#39;/&#39;);<br>  //await page.goto(&#39;https://www.saucedemo.com/&#39;);<br>  await page.locator(&#39;[data-test=&quot;username&quot;]&#39;).click();<br>  await page.locator(&#39;[data-test=&quot;username&quot;]&#39;).fill(targetUser[&quot;username&quot;]);<br>  await page.locator(&#39;[data-test=&quot;password&quot;]&#39;).click();<br>  await page.locator(&#39;[data-test=&quot;password&quot;]&#39;).fill(targetUser[&quot;password&quot;]);<br>  await page.locator(&#39;[data-test=&quot;login-button&quot;]&#39;).click();<br>  const currentURL = page.url();<br>  expect(currentURL).toBe(&#39;https://www.saucedemo.com/inventory.html&#39;)<br>  await expect(page.locator(&#39;#header_container&#39;)).toContainText(&#39;Swag Labs&#39;);<br>});</pre><p>Important Note: Import the ‘test’ function from the helper we created using the following path ‘../helpers/test-options’.</p><p><strong>Step 9.</strong> Update Project section</p><pre>import { defineConfig, devices } from &#39;@playwright/test&#39;;<br>import type { TestOptions } from &#39;./helpers/test-options&#39;;<br>import { USERS } from &#39;./test_data/login.data&#39;;<br><br>export default defineConfig&lt;TestOptions&gt;({<br>projects: [<br>    {<br>      name: &#39;standard_user&#39;,<br>      use: { ...devices[&#39;Desktop Chrome&#39;], targetUser: USERS[&#39;standard_user&#39;] },<br>    },<br>    {<br>      name: &#39;locked_out_user&#39;,<br>      use: { ...devices[&#39;Desktop Chrome&#39;], targetUser: USERS[&#39;locked_out_user&#39;] },<br>    },<br>    {<br>      name: &#39;problem_user&#39;,<br>      use: { ...devices[&#39;Desktop Chrome&#39;], targetUser: USERS[&#39;problem_user&#39;] },<br>    },<br>    {<br>      name: &#39;performance_glitch_user&#39;,<br>      use: { ...devices[&#39;Desktop Chrome&#39;], targetUser: USERS[&#39;performance_glitch_user&#39;] },<br>    },<br>    {<br>      name: &#39;error_user&#39;,<br>      use: { ...devices[&#39;Desktop Chrome&#39;], targetUser: USERS[&#39;error_user&#39;] },<br>    },<br>    {<br>      name: &#39;visual_user&#39;,<br>      use: { ...devices[&#39;Desktop Chrome&#39;], targetUser: USERS[&#39;visual_user&#39;] },<br>    },<br>}</pre><p><strong>Step 10</strong>. Run all projects using the command: npx playwright test</p><p>By default, Playwright generates test reports that include information about test execution, success or failure of individual tests, and any errors encountered during the test run. The purpose of the reporter is to provide visibility into the test results, making it easier for developers or testers to understand the outcome of their automated tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FKtwbhYN6xoz_QcxbcVHIw.png" /><figcaption>Playwright Report View</figcaption></figure><p>In this specific instance, the test cases executed are listed along with the information on the users that have been processed. A deliberate inclusion of a failed test case, ‘locked-out-user,’ is made to showcase a scenario where login into the application fails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eIUhJD0Ysc6hofVN8wL2FA.png" /><figcaption>Additional information listed for failed test case</figcaption></figure><p><strong>Step 11</strong>. To run a specific project, utilize the following command: npx playwright test -project=&lt;project name&gt;. This command executes the login test case against a predefined dataset for the specified project.</p><h4>Conclusion.</h4><p>In this piece, I shared my findings regarding parameterization in Playwright projects, covering aspects ranging from establishing test data to updating configurations and implementing options. Through the utilization of this feature, there is potential to improve maintainability, broaden test coverage, and improve the efficiency of issues identification.</p><p><strong>Resources</strong>:</p><ol><li><em>Test Parameterize</em>: <a href="https://playwright.dev/docs/test-parameterize">https://playwright.dev/docs/test-parameterize</a></li><li><em>Fixtures</em>: <a href="https://playwright.dev/docs/test-fixtures">https://playwright.dev/docs/test-fixtures</a></li><li><em>Repo with demo-project</em>: <a href="https://github.com/nora-weisser/playwright_demo">https://github.com/nora-weisser/playwright_demo</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82da3b8a1baf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unit Testing with Jest and Integration with GitHub Actions]]></title>
            <link>https://qa-nora.medium.com/unit-testing-with-jest-and-integration-with-github-actions-bc241b31d257?source=rss-5b22734b1e50------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc241b31d257</guid>
            <category><![CDATA[jest]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Eleonora Belova ]]></dc:creator>
            <pubDate>Tue, 23 Jan 2024 08:13:14 GMT</pubDate>
            <atom:updated>2024-01-23T08:29:57.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eluZ-ITF7qJC0tbJ0isiFg.png" /></figure><h4>How to approach Unit Testing with Jest and continuously monitor within development workflow?</h4><h4><strong>What is Unit Testing?</strong></h4><p><strong>Unit Testing</strong> is software testing technique where individual units or components of a software application are tested in isolation from the rest of the system.</p><p>The purpose of unit testing is to validate that each unit of the software performs as designed.</p><p>A <strong>unit</strong> in this context is the smallest testable part of an application, typically a <em>function</em>, a <em>method</em> or a <em>class</em>.</p><h4>Best Practices for Unit Testing</h4><ol><li><strong>Unit tests should focus on smallest units of code</strong>, therefore test cases should ensure that individual functions, methods, classes work as expected.</li><li><strong>Keep test cases independent.</strong> Ensure that failures in one test will not cause failure in another one.</li><li><strong>Focus on verifying a single concept or behavior. </strong>Do not test multiple functionalities within a single test case. It will make it significantly harder to troubleshoot in case of a problem.</li><li><strong>Ensure that your test cases cover edge scenarios</strong>, boundary values and exceptional conditions.</li></ol><blockquote>Blog: <a href="https://medium.com/@kaanfurkanc/unit-testing-best-practices-3a8b0ddd88b5">https://medium.com/@kaanfurkanc/unit-testing-best-practices-3a8b0ddd88b5</a></blockquote><h4>Getting started with Jest</h4><blockquote>Repo with source code: <a href="https://github.com/nora-weisser/testing-with-jest">https://github.com/nora-weisser/testing-with-jest</a></blockquote><p>First, you need to have Node.js installed on your machine. You can download it from <a href="https://nodejs.org/">https://nodejs.org/.</a></p><p>Initialize a new Node.js project by running the following command in your terminal:</p><pre>npm init -y</pre><p>Install Jest using npm:</p><pre>npm install --save-dev jest</pre><p>Open your package.json file and add the following scripts section and past this code into <em>scripts</em> section:</p><pre>&quot;scripts&quot;: {<br>  &quot;test&quot;: &quot;jest&quot;<br>}</pre><h4>Write your first test case using Jest</h4><p>Let’s consider a function that filters an array of numbers to include only even numbers (numberFilter.js).</p><pre>function filterEvenNumbers(numbers) {<br>  return numbers.filter((number) =&gt; number % 2 === 0);<br>}<br><br>module.exports = filterEvenNumbers;</pre><p>Then create another file called numberFilter.test.js and write several test cases to cover major functionality:</p><pre>const filterEvenNumbers = require(&#39;./numberFilter&#39;);<br><br>test(&#39;Filter even numbers&#39;, () =&gt; {<br>  const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];<br>  const filteredNumbers = filterEvenNumbers(numbers);<br>  expect(filteredNumbers).toEqual([2, 4, 6, 8, 10]);<br>});<br><br>test(&#39;Filter even numbers in an empty array&#39;, () =&gt; {<br>  const numbers = [];<br>  const filteredNumbers = filterEvenNumbers(numbers);<br>  expect(filteredNumbers).toEqual([]);<br>});<br><br>test(&#39;Filter even numbers in an array with no even numbers&#39;, () =&gt; {<br>  const numbers = [1, 3, 5, 7, 9];<br>  const filteredNumbers = filterEvenNumbers(numbers);<br>  expect(filteredNumbers).toEqual([]);<br>});<br><br>test(&#39;Filter even numbers in an array with all even numbers&#39;, () =&gt; {<br>  const numbers = [2, 4, 6, 8, 10];<br>  const filteredNumbers = filterEvenNumbers(numbers);<br>  expect(filteredNumbers).toEqual([2, 4, 6, 8, 10]);<br>});</pre><p>In this example, target function is important to the test file and four test cases created, where:</p><ol><li><em>Test case 1 </em>validates if the function filters even numbers in array containing all types of numbers in the array</li><li><em>Test case 2</em> considers an empty array as an input and validates if the function returns an empty array as a result.</li><li><em>Test case 3</em> validates filtering in the array which doesn’t contain even numbers at all.</li><li><em>Test case 4</em> validates if the function returns all the even numbers in array if the input array contains only even numbers.</li></ol><p>All these test cases contain data (const numbers), function execution (const filteredNumbers = filterEvenNumbers(numbers)) and assertion. Jest uses “matchers” to let you test values in different ways. You can find the full list of matchers in the official documentation: <a href="https://jestjs.io/docs/expect">https://jestjs.io/docs/expect</a></p><p>Run the tests using:</p><pre>npm test</pre><h4>How to organize test cases</h4><p>Let’s consider other functions:</p><ul><li>The addItem function adds an item to the list.</li><li>The clearList function removes all items from the list.</li><li>The getList function returns the whole list with items.</li></ul><p>You can find the implementation below:</p><pre>// itemManager.js<br><br>let itemList = [];<br><br>function addItem(item) {<br>  itemList.push(item);<br>}<br><br>function clearList() {<br>  itemList = [];<br>}<br><br>function getList() {<br>  return itemList;<br>}<br><br>module.exports = {<br>  addItem,<br>  clearList,<br>  getList,<br>};</pre><p>In order to isolate test cases, we will use beforeEach and afterEach hooks to set up and clean up the test environment.</p><p>Now, let’s create a file named itemManager.test.js with the following content:</p><pre>const { addItem, clearList, getList } = require(&#39;./itemManager&#39;);<br><br>// Set up the test environment<br>beforeEach(() =&gt; {<br>  addItem(&#39;Item 1&#39;);<br>  addItem(&#39;Item 2&#39;);<br>  addItem(&#39;Item 3&#39;);<br>});<br><br>// Clean up the test environment<br>afterEach(() =&gt; {<br>  clearList();<br>});<br><br>// Test case 1: Adding an item to the list<br>test(&#39;Add item to the list&#39;, () =&gt; {<br>  addItem(&#39;New Item&#39;);<br>  expect(getList()).toContain(&#39;New Item&#39;);<br>});<br><br>// Test case 2: Clearing the list<br>test(&#39;Clear the list&#39;, () =&gt; {<br>  clearList();<br>  expect(getList()).toHaveLength(0);<br>});<br><br>// Test case 3: Getting the list<br>test(&#39;Get the list&#39;, () =&gt; {<br>  const list = getList();<br>  expect(list).toHaveLength(3);<br>  expect(list).toEqual([&#39;Item 1&#39;, &#39;Item 2&#39;, &#39;Item 3&#39;]);<br>});</pre><p>In this example:</p><ul><li>The beforeEach hook is used to set up the initial state by adding three items to the list before each test case.</li><li>The afterEach hook is used to clean up the state by clearing the list after each test case.</li></ul><p>This ensures that each test case runs in an expected initial state and doesn’t interfere with other tests. The addItem, clearList, and getList functions from itemManager.js are used to perform actions and assertions in the test cases.</p><p>These hooks provide a convenient way to manage the state of your tests, especially when you need to set up or tear down common resources before and after test cases.</p><p>Another trick to organise test cases is Arrange-Act-Assert (AAA) Pattern: Arrange (setup a test environment, variables or any other information needed for test execution), Act (perform the action being tested) and Assert (verify the expected result). It helps with readability and improves the ease of maintenance process.</p><blockquote>Blog: <a href="https://medium.com/@pjbgf/title-testing-code-ocd-and-the-aaa-pattern-df453975ab80">https://medium.com/@pjbgf/title-testing-code-ocd-and-the-aaa-pattern-df453975ab80</a></blockquote><p>! Don’t forget to write clear and descriptive test names. It makes it easier to understand the purpose of each test case and facilitate maintenance.</p><h4>Implement Continuous Integration (CI)</h4><p>CI/CD pipeline integration ensures that tests are automatically run whenever changes are made to the codebase, providing rapid feedback to developers. Putting it to our particular situation: we would like to set up the pipeline that will always run in the feature branch before merging into main to make sure that it doesn’t introduce issues. It will be automated process which will conduct continuous monitoring during development. Our Jest tests should be successful for the feature branch before merging it to main.</p><p>To implement CI/CD pipeline I will use <a href="https://github.com/features/actions">GitHub Actions</a>. GitHub Actions has a very generous free tier for public repositories. If you’re using a public repository, GitHub Actions is completely free of charge.</p><blockquote><strong>Extra resource:</strong> <a href="https://www.youtube.com/watch?v=R8_veQiYBjI">GitHub Actions Tutorial — Basic Concepts and CI/CD Pipeline with Docker (video)</a></blockquote><ol><li><strong>Create a branch</strong></li></ol><p>Let’s first create a feature branch called test/github-actions to test out our first GitHub Actions workflow. You can do that by executing the following in your terminal:</p><pre>git checkout -b test/github-actions</pre><p>The feature branch should be created and you automatically should be checked out.</p><p>2. <strong>Create GitHub Actions directory</strong></p><p>For GitHub Actions pipeline we have to create ymlfile and specify which step need to be taken to our pipeline. Yml file will be created in.github/workflows directory.</p><p>Run following command in terminal:</p><pre>mkdir -p .github/workflows<br>touch .github/workflows/main.yml</pre><p>3. <strong>Implement a pipeline by defining triggers for GitHub Actions</strong></p><p><em>Our goals:</em></p><ul><li>The workflow should be triggered only on the pull_request event targeting the main branch.</li><li>The status check should be automatically created on GitHub when this workflow runs as part of a pull request. The PR will not be mergeable until this status check passes.</li></ul><p>Now, whenever we open a pull request, GitHub Actions will run the Jest tests and report the status back to the pull request. The PR can only be merged if the tests pass.</p><p>You can find implementation down below:</p><pre>name: Run Tests<br><br>on:<br>  pull_request:<br>    branches:<br>      - main<br><br>jobs:<br>  test:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - name: Checkout repository<br>        uses: actions/checkout@v2<br><br>      - name: Set up Node.js<br>        uses: actions/setup-node@v3<br>        with:<br>          node-version: &#39;14&#39;<br><br>      - name: Install dependencies<br>        run: npm install<br><br>      - name: Run Jest tests<br>        run: npm test</pre><p><strong>4. Create a PR to test GitHub Actions pipeline.</strong></p><p>Push your changes into remote branch and open a PR. Check out if the checks have been applied.</p><p>This is what you should see when reviewing a PR: your PR into main branch triggered Jest test cases execution and reported results back to pull request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lz2rRQgok76apZCHtdRoKA.png" /></figure><p>You can click on the <strong>Details</strong> link to navigate to the CI/CD pipeline to check the steps that you just defined in the .yml file. That status page looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kd8FfKChoaBfohQnFDKSOw.png" /></figure><p>Returning to the pull request’s status page, we can see that all GitHub Actions checks have been successfully completed. As a result, the pull request is ready to be merged without encountering any issues.</p><h4>Conclusion</h4><p>In this article we’ve gone through the aspects of writing unit tests using the Jest framework for ensuring the reliability and correctness of JavaScript functions. I uncovered some insights into structuring test files, creating meaningful test cases, and running tests using Jest.</p><p>Additionally, the integration of GitHub Actions has been showcased as an effective tool to automate the testing workflow. The configured workflow ensures that every push triggers a set of tests, maintaining the codebase’s integrity.</p><blockquote>The complete source code can be found <a href="https://github.com/nora-weisser/testing-with-jest">here</a>.</blockquote><blockquote>Jest testing approach and integration with GitHub Actions have been nicely explained during Women Who Code London Workshop within Contributors Study Group. You can find video <a href="https://youtu.be/DNqJYJoEdsM?si=-AL21N5lWtACjidC">here</a>.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc241b31d257" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uncovering “Magic Box” or experimenting with LLM for API Testing]]></title>
            <link>https://qa-nora.medium.com/uncovering-magic-box-or-experimenting-with-llm-for-api-testing-c526c00b9fdf?source=rss-5b22734b1e50------2</link>
            <guid isPermaLink="false">https://medium.com/p/c526c00b9fdf</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Eleonora Belova ]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 11:48:16 GMT</pubDate>
            <atom:updated>2023-11-27T11:48:16.932Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDuHoTYpjG6KMyG_fpmy_w.png" /></figure><h3>Everyone is talking about Generative AI.</h3><p>Recently, I had the opportunity to attend a fascinating Meetup in Amsterdam organized by Girls Code and Rockstars IT, titled ‘AI — Woman vs. Machine’. The focus was on AI and leveraging Language Model Models (LLMs) in both professional and personal contexts. The buzz around generative AI is growing, yet not everyone fully comprehends its potential.</p><p>Describing AI can be quite challenging; often, it’s linked to a magic box with inputs and outputs, as Ramona Domen put it. However, the crucial point to grasp is the significance of context. The clarity of your input or prompt directly influences the quality of output from generative AI. In essence, the better defined your input, the more precise and reliable the output tends to be.</p><p>The concept of <strong>Prompt Engineering</strong> is essential here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WTuojrB8z0vySb-3.jpeg" /></figure><h3>What is Prompt Engineering?</h3><p>Recently I got a chance to enroll to the course <a href="https://www.thetesttribe.com/courses/generative-ai-software-testing/">Gen AI for Testers</a> and decided to play around with ChatGPT, explore the capabilities and ways I can use it in my day to day work. The course emphasizes Prompt Engineering as a core concept, which I found particularly intriguing.</p><p>What precisely does Prompt Engineering mean?</p><blockquote><strong><em>Prompt engineering</em></strong><em> refers to the process of designing and refining prompts to achieve specific goals when using a language model like ChatGPT. It involves formulating clear instructions, providing content, and specifying the desired output format to guide the model’s responses effectively.</em></blockquote><p>For instance, consider the difference between two prompts:</p><blockquote><em>“How to test API?”</em></blockquote><h3>and</h3><blockquote><em>“I’m an Automation Test Engineer working on API tests. Could you provide test cases for the login functionality for a security application?”</em></blockquote><p><em>The second prompt is a more focused and actionable response compared to the vague and broad nature of the first one.</em></p><h3>Building effective prompt engineering</h3><p>Let’s take a look at what makes prompt engineering successful. What specific steps are involved in creating an effective prompt?</p><h3>✅ Define objective clearly</h3><p>This involves articulating with precision the specific goals and desired outcomes you aim to achieve through the interaction with ChatGPT. By clarifying these objectives, you set a clear direction for the model, guiding it to generate responses aligned with your intended purposes.</p><h3>✅ Choose the right context</h3><p>It involves providing the necessary background information, details, or settings that frame the conversation for the language model. By choosing the right context, you effectively orient the model towards understanding the specific scenario or subject matter, enabling more relevant and accurate responses.</p><h3>✅ Specify the format</h3><p>You might want to see the response in certain format, like: json, table or list. Let’s take a look at the example: “Create a user in json format with name, address and age”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BoWB7mQTYRQ_xmrF.png" /></figure><h3>✅ Use system messages.</h3><p>Using system messages is a strategy in prompt engineering where you include additional information or context within the conversation that guides the language model’s understanding. These messages are not the primary prompts but serve as instructions or clarifications to direct the model’s responses.</p><p>For instance, if a user asks, “How do I test an API endpoint?” a system message could be incorporated to provide further details: “You are a senior developer helping colleagues understand API testing best practices.”</p><p>By including such system messages, you offer context to the model about the role or perspective of the user, helping it tailor more precise and relevant responses.</p><h3>✅ Iterate and refine</h3><p>Iterating and refining is a crucial aspect of prompt engineering that involves an ongoing process of improvement and adjustment in the prompts used to interact with a language model.</p><h3>✅ Collaborate with community</h3><p>Engaging in collaboration with fellow engineers and actively sharing insights on forums and conferences regarding prompt engineering is paramount. This collaborative effort serves as a valuable avenue to stay updated on the latest advancements in this field, enabling you to continually refine your expertise and master this skill.</p><p>Additionally, adjusting temperature and token settings, refining prompts with more details, and testing on diverse scenarios are crucial for effective prompt engineering. It’s also essential to be mindful of safety and bias.</p><p>Please, find <a href="https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-openai-api">more resources</a> on OpenAI Website.</p><h3>✍️ It is time to use all these principles in practice!</h3><p>🎯 My goal is: to generate comprehensive test cases for GET API Endpoint: <a href="https://www.boredapi.com/api/%7Btype%7D"><em>https://www.boredapi.com/api/{type}</em></a></p><p>Official Documentation: <a href="https://www.boredapi.com/">https://www.boredapi.com/</a></p><h3>Define the context and objective</h3><p><em>✍️ Using the following prompt:</em></p><blockquote><em>You are tasked with writing test cases to verify the functionality and behaviour of the GET method on the following URL: “https://www.boredapi.com/api/{type}”. The Bored API helps you find things to do when you’re bored.</em></blockquote><blockquote><em>Possible type of the activity: [“education”, “recreational”, “social”, “diy”, “charity”, “cooking”, “relaxation”, “music”, “busywork”].</em></blockquote><blockquote><em>Design comprehensive test cases to ensure the correctness and reliability of the GET request response. Consider different scenarios, including valid and invalid inputs, edge cases and potential error conditions. Please provide test cases details, including the request method, URL, parameters, expected outcomes, and any additional relevant information for each test case.</em></blockquote><p><em>🤖 Response from ChatGPT:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*wg_hin71YYMY29MH.png" /></figure><h3>Iterate and Refine</h3><p>This response looks helpful for further implementation, but I think some cases are missing and I would like to iterate and refine the response.</p><p><em>✍️ My Prompt:</em></p><blockquote><em>Could you please include test cases for all possible scenarios.</em></blockquote><p><em>🤖 Response from ChatGPT:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*cPB7svarXuC3DK74.png" /></figure><h3>Specify the format</h3><p>I am almost satisfied with this result, but since it is easier for me to grasp information in the table.</p><p><em>✍️My Prompt:</em></p><blockquote><em>Please, use the tabular format</em></blockquote><p><em>🤖 Response from ChatGPT:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*rcdm1V6-KTReVmrD.png" /></figure><h3>More ideas on how to master prompt engineering</h3><p>You can find more helpful examples of prompts you can use in ChatGPT. It depends on what your goal is. For example: you would like to know how to translate certain phrases to French.</p><p>Navigate to: <a href="https://platform.openai.com/examples">https://platform.openai.com/examples</a> and find Grammar Correction.</p><p><em>There is a prompt provided to you:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bfcEuH39HLUfeSjT.png" /></figure><blockquote><em>SYSTEM</em></blockquote><blockquote><em>You will be provided with statements, and your task is to convert them to standard English.</em></blockquote><blockquote><em>USER</em></blockquote><blockquote><em>She no went to the market.</em></blockquote><p>Open ChatGPT and try to get expected result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4WgJnak5YdXAM4zQ.png" /></figure><p>This is the same result you can see in the sample response.</p><h3>Want to master skills further?</h3><p>Then try to experiment with different prompts, like:</p><ul><li>Translation</li><li>Parse Unstructured Data</li><li>Calculate Time Complexity</li><li>Explain Code</li><li>JavaScript to Python</li><li>Create SQL Query</li><li>etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*qR7HgI6QV6Vjsold.png" /></figure><p><a href="https://platform.openai.com/examples">https://platform.openai.com/examples</a></p><p>To delve deeper into prompt engineering, I’ve included another helpful resource from OpenAI: you can find it here — <a href="https://platform.openai.com/docs/guides/prompt-engineering">https://platform.openai.com/docs/guides/prompt-engineering</a></p><h3>Conclusion</h3><p>While I’m still in the process of completing the Gen AI for Testers course, the potential benefits of incorporating ChatGPT into the toolkit of testers and engineers are already visible. An essential lesson learned is “Context matters” — accurate input results in precise results. This underscores the importance of providing precise information to attain the desired outcomes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c526c00b9fdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 2. How to approach API testing?]]></title>
            <link>https://qa-nora.medium.com/part-2-how-to-approach-api-testing-be82162e4d9e?source=rss-5b22734b1e50------2</link>
            <guid isPermaLink="false">https://medium.com/p/be82162e4d9e</guid>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Eleonora Belova ]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 20:27:41 GMT</pubDate>
            <atom:updated>2023-08-22T20:27:41.765Z</atom:updated>
            <content:encoded><![CDATA[<h3>🤨 What is API Testing?</h3><p>API testing is important for validating the functionality of the API and ensuring that it meets the functional requirements. It is critical for integration testing since APIs are used to communicate between different software systems. API testing helps to identify issues early in the development cycle and prevents costly bugs and errors in production. This process is designed to not only test the API’s functionality — but also its reliability, performance, and security.</p><h3>🧪 Why should you care about API Testing?</h3><ul><li><em>You can find bugs earlier and save money</em></li></ul><p>Testing REST requests means you can find bugs earlier in the development process, sometimes even before the UI has been created!</p><blockquote>FACT:</blockquote><blockquote>According to <a href="https://www.researchgate.net/figure/IBM-System-Science-Institute-Relative-Cost-of-Fixing-Defects_fig1_255965523">the Systems Sciences Institute at IBM</a>, the cost to fix a bug found during implementation is about six times higher than one identified during design. The cost to fix an error found after product release is then four to five times as much as one uncovered during design, and up to 100 times more than one identified during the maintenance phase. In other words, the cost of a bug grows exponentially as the software progresses through the SDLC.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/0*-vaIQV76LFhCsQib" /><figcaption>Relative Cost of Fixing Defects</figcaption></figure><ul><li><em>You can find flaws before they are exploited</em></li></ul><p>Malicious users know how to make REST request and can use them to exploit security flaws in your application by making requests the UI doesn’t allow; you’ll want to find and fix these flaws before they are exploited</p><ul><li>It is easy to automate</li><li>Automation scripts run much faster than UI Automation</li></ul><h3>❌ Everything could go wrong!</h3><p>When working with API, there set of risks and potential bugs that you might avoid to ensure the reliability and security of the application (not limited list of risks):</p><p><strong>⚠️ Risk#1.</strong> We could extract personal / private information without proper authentication. It could lead to unauthorized access problems and data breaches.</p><p><strong>🐞 Bugs</strong>: Missing or misconfigured authentication tokens, incorrect permission settings, or bypassing authorization checks.</p><p><strong>⚠️ Risk#2. </strong>When a user sends wrong data in the wrong format, it could break the system with 500 errors.</p><p><strong>⚠️ Risk#3.</strong> Improper input validation can lead to security vulnerabilities like SQL-injection cross-site scripting.</p><p><strong>🐞 Bugs</strong>: not validation request parameters, not handling unexpected data formats properly</p><p><strong>⚠️ Risk#4.</strong> Insecure data transmission. Transmitting data using unencrypted channels could lead to exposing sensitive information or interception.</p><p><strong>🐞 Bugs</strong>: Not using HTTPS, ignoring SSL certification</p><p><strong>⚠️ Risk#5.</strong> Poor error handling may lead to exposing sensitive information or make difficult diagnosing of issues</p><p><strong>🐞 Bugs</strong>: returning too details error messages which are revealing implementation details or which are not providing necessary information to the user</p><p><strong>⚠️ Risk#6.</strong> Performance issues. API doesn’t handle loads efficiently which can lead to performance degradation or outages.</p><p><strong>🐞 Bugs</strong>: memory leaks, inefficient database queries, not optimized API response times.</p><p><em>This schema illustrates the types of questions that a tester can pose to ensure comprehensive API testing. This list is not limited.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5X48MptVnOASibB8rKCZLQ.png" /><figcaption><em>Questions that a tester can pose to ensure comprehensive API testing</em></figcaption></figure><h3>💡 Let’s take a look at the API Testing in more detail</h3><p>Introduced by Mike Cohn in his book <a href="https://www.oreilly.com/library/view/succeeding-with-agile/9780321660534/">Succeeding with Agile (2009)</a>, the pyramid is a metaphor for thinking about testing in software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/0*TMCToE8xYwRxlK5l.jpg" /></figure><p>The testing pyramid is a concept in software testing that represents the ideal distribution of different types of tests in a software development process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*u0QVH_gPkLAtIbgK.jpg" /><figcaption>Source: <a href="https://semaphoreci.com/blog/testing-pyramid">https://semaphoreci.com/blog/testing-pyramid</a></figcaption></figure><p>It emphasises having a larger number of lower-level tests and a smaller number of higher-level tests. The testing pyramid is a way to ensure a balanced and effective testing strategy.</p><p>I adjusted this pyramid to API Testing and what I’ve got:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*qU9TqthSClGDbf3ncYZSjw.png" /><figcaption>API Testing Pyramid</figcaption></figure><h4><strong>Unit Testing</strong></h4><p>Unit tests, unit tests and unit tests once more. Everybody knows the benefits of unit tests: we should be able to identify any problems with the current components of APIs as soon as possible. The higher unit tests coverage, the better for you and your product.</p><h4><strong>Contract Testing</strong></h4><p>Assert that the specs have not changed. This type of testing is used to test the contracts or agreements established between various software modules, components, or services that communicate with each other via APIs. These contracts specify the expected inputs, outputs, data formats, error handling, and behaviours of the APIs.</p><p><strong>JSON-schema</strong> is a contract that defines the expected data, types and formats of each field in the response and is used to verify the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1pxAcztS-9iaBJf20aqYlQ.png" /><figcaption>Example of JSON Schema</figcaption></figure><p>Official Documentation: <a href="https://json-schema.org/">https://json-schema.org/</a></p><h4><strong>Functional Testing</strong></h4><p>The purpose of functional testing is to ensure that you can send a request and get back the anticipated response along with status. That includes positive and negative testing. Make sure to cover all of the possible data combinations.</p><p><strong><em>Test Scenario categories:</em></strong></p><ul><li>Happy Path (Positive test cases) checks basic information and if the main functionality met</li><li>Positive test cases with optional parameters. With these test cases it is possible to extend positive test cases and include more extra checks</li><li>Negative cases. Here we expect the application to gracefully handle problem scenarios with both valid user input (for example, trying to add an existing username) and invalid user input (trying to add a username which is null)</li><li>Authorization, permission tests</li></ul><p><strong>How to start with Functional Testing?</strong></p><ol><li>Read API documentation / specification / requirements carefully to understand its endpoints, request methods, authentication methods, status codes and expected responses.</li><li>Based on the functionality you are going to test, outline positive and negative test scenarios which cover use cases and some edge cases as well. Revisit Functional API Testing section for more details.</li><li>Setup test environment: create a dedicated test environment that mirrors the production environment.</li><li>Select an appropriate tool (for example, Postman, Insomnia), frameworks (for example, pytest, JUnit, Mocha), technologies, programming languages (Python, Javascript, Java, etc.) with appropriate libraries for API Testing.</li><li>Plan Test Data: It is always important to populate the environment with the appropriate data.</li><li>Write Automation scripts: Automate repetitive test cases, like smoke, regression suites to ensure efficient and consistent testing. Validate responses against expected outcomes and assertions, checking for proper status codes, headers, and data content.</li><li>Test the API’s error-handling mechanisms: Verify that the API responds appropriately with clear error messages and correct status codes.</li><li>Document Test Results: Maintain detailed documentation of test cases, expected outcomes, actual results to make onboarding of new team members easier.</li><li>Collaborate with developers: it is important to have consistent catch-ups with your team and stakeholders to review test results and address any identified issues.</li><li>Continuous Improvement: Continuously refine and improve your testing process based on lessons learned from previous test cycles.</li><li>Feedback Loop: Provide feedback to the development team regarding the API’s usability, performance, and any issues encountered during testing.</li></ol><h4><strong>Non-Functional</strong></h4><p>Non-functional API testing is where the testers check the non-functional aspects of an application, like its performance, security, usability, and reliability. Simply put, the functional test focuses on whether API works, whereas non-functional tests focus on how well API works.</p><h4><strong>End-to-end testing</strong></h4><p>In general, end-to-end testing is the process of testing a piece of software from start to finish. We are checking it by mimicking user actions. If it comes to API, it is crucial to check if APIs can communicate properly by making call like a real client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWVd97kGHEvV9icxn8vM8g.png" /></figure><h4><strong>Exploratory testing</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*KUTInf7NkxqUPont" /><figcaption>Source: Google Images</figcaption></figure><blockquote><strong>You’re not done testing until you’ve checked that the software meets expectations and you’ve explored whether there are additional risks. A comprehensive test strategy incorporates both approaches.</strong></blockquote><blockquote>Elisabeth Hendrickson, book “Explore It!”</blockquote><p>When all automation and scripted testing is performed, it is time to examine an API, interact and observe its behavior. This is a great way to learn and explore edge cases to uncover issues that automated or scripted testing would have missed.</p><p><em>There are two ways of doing it:</em></p><ol><li>When test engineer performs it individually, He/She needs to apply domain knowledge intuition, critical thinking and user-centric thinking.</li><li>There is another way — pair testing which involves two people: driver and navigator. It is a time-boxed testing when the driver performs the actual testing while the navigator observes, provides guidance, and takes notes where necessary. This approach maximizes a level of creativity and encourages knowledge sharing and better collaboration between team members.</li></ol><p>More information: <a href="https://www.agileconnection.com/article/two-sides-software-testing-checking-and-exploring">https://www.agileconnection.com/article/two-sides-software-testing-checking-and-exploring</a></p><p>Book “Explore It!”: <a href="https://learning.oreilly.com/library/view/explore-it/9781941222584/">https://learning.oreilly.com/library/view/explore-it/9781941222584/</a></p><blockquote>BONUS:</blockquote><blockquote>Health Check API: transition to the cloud and refactoring of the applications to microservices introduced new challenges in effective monitoring these microservices at scale. To standardise the process of validating the status of a service and its dependencies, it becomes helpful to introduce a health check API endpoint to a RESTful (micro) service. As part of the returned service status, a health check API can also include performance information, such as component execution times or downstream service connection times. Depending on the state of the dependencies, an appropriate HTTP return code and JSON object are returned.</blockquote><h3>🎬 Conclusion</h3><p>In conclusion, mastering the art of API testing requires a good approach that includes strategic planning, and continuous improvement.</p><p>Remember, API testing is not a one-time effort, but an ongoing process that evolves alongside your software development lifecycle. Continuous improvement is key to refining your API testing strategy. Regularly review and update your test cases, incorporating changes due to new features, bug fixes, or code refactoring. Learn from exploratory testing output, identify areas of improvement by listening to your customer’s and team’s feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be82162e4d9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 1: API explained]]></title>
            <link>https://qa-nora.medium.com/part-1-api-explained-f2bb9eceed0c?source=rss-5b22734b1e50------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2bb9eceed0c</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[api-testing]]></category>
            <dc:creator><![CDATA[Eleonora Belova ]]></dc:creator>
            <pubDate>Thu, 03 Aug 2023 20:18:41 GMT</pubDate>
            <atom:updated>2023-08-03T20:37:16.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*YrVYFtEiQC6ySf1JxmUraQ.png" /></figure><p>This is the first part of series about API Testing. I am going to start with general concepts, I will talk about fundamental concept of APIs, tracing their historical roots, exploring various types of protocols they employ, and understanding the essential components that constitute an API.</p><h4>A Historical Perspective</h4><p>Back in the 1950s, an API was understood as a potential method to facilitate communication between two computers. This term was first mentioned in a 1951 book written by Maurice Wilkes and David Wheeler called ‘The Preparation of Programs for an Electronic Digital Computer’. It outlined several key computing terms, including the first API. At this stage, an API was starting to exist, but they were limited to simple, command-line interfaces that enabled programmers to interact with computers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*ySohTUDPgcoFLo96JGQlGA.jpeg" /><figcaption><em>The Preparation of Programs for an Electronic Digital Computer, </em>Maurice Wilkes and David Wheeler</figcaption></figure><blockquote>Blog: <a href="https://blog.postman.com/intro-to-apis-history-of-apis/">https://blog.postman.com/intro-to-apis-history-of-apis/</a></blockquote><h4>What is API?</h4><p>API is an Application Programming Interface. API is a set of routines, protocols and tools for building Software Application.</p><h4>How API evolved throughout the time?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*gOIRDWBVgeBh7DhnOFrKmw.png" /><figcaption>The diagram illustrates the API timeline and API styles comparison. Source: <a href="https://blog.bytebytego.com/p/soap-vs-rest-vs-graphql-vs-rpc">https://blog.bytebytego.com/p/soap-vs-rest-vs-graphql-vs-rpc</a></figcaption></figure><p>Throughout the time the internet has changed and evolved, applications and APIs evolved along with it. Many years ago APIs were built with strict rules to allow the two sides of the interface talking to each other. Over time, different API protocols have been released, each of them has its own pattern of standardizing data exchange.</p><ol><li><strong>SOAP</strong> is an XML-formatted, highly standardized web communication protocol. Released by Microsoft in the 1990s. XML data format drags behind a lot of formality. Paired with the massive message structure, it makes SOAP the most verbose API style.</li><li>In the early 2000s, the web started to shift towards a more consumer-based place. Some e-commerce sites, such as eBay and Amazon, started using APIs, which are more public and flexible. Twitter, Facebook and others joined them as well in using REST APIs.</li></ol><p>This API style was originally described in 2000 by Roy Fielding in his doctoral dissertation.</p><p><strong>REST is the Representational State Transfer Protocol.</strong> REST makes server-side data available representing it in simple formats, often JSON. It is the most commonly used protocol nowadays.</p><p>3. The internet continued to change, mobile applications were becoming popular. Companies faced challenges with the amount of data they wanted to transfer on mobile devices. So, Facebook created <strong>GraphQL</strong>. This query language helps to reduce the amount of data that gets transferred while introducing a slightly more rigid structure to the API.</p><p>4. <strong>gRPC</strong> was developed by Google for implementing distributed software systems that need to run fast on a massive scale. Initially, it was not standardized to be used as a generic framework as it was closely tied to Google’s internal infrastructure. In 2015 Google liberalized it as open source and standardized it for community use, under the name gRPC. During the first year of its launch, it was adopted by large companies such as Netflix, Docker or Cisco among others.</p><blockquote>REST API vs. SOAP vs. GraphQL vs. gRPC by Alex Xu: <a href="https://www.altexsoft.com/blog/soap-vs-rest-vs-graphql-vs-rpc/">https://www.altexsoft.com/blog/soap-vs-rest-vs-graphql-vs-rpc/</a></blockquote><blockquote>More about REST API: <a href="https://blog.bytebytego.com/p/the-foundation-of-rest-api-http">https://blog.bytebytego.com/p/the-foundation-of-rest-api-http</a></blockquote><blockquote>What is RESTful API so popular: <a href="https://blog.bytebytego.com/p/why-is-restful-api-so-popular">https://blog.bytebytego.com/p/why-is-restful-api-so-popular</a></blockquote><h4>API in more detail</h4><p>The working principle of API is commonly expressed through the request-response communication between a client and a server. In a web API, a client is on one side of the interface and sends requests, while a server (or servers) is on the other side of the interface and responds to the request.</p><p>Since the REST API is the most popular, we are going to talk about it in detail.</p><p><strong>These are the general steps for any REST API call:</strong></p><ol><li>Client sends a request to the server. The client follows the API documentation to format the request in a way that the server understands.</li><li>The server authenticates the client and confirms that the client has the right to make that request.</li><li>The server receives the request and processes it internally.</li><li>The server returns a response to the client. The response contains information that tells the client whether the request was successful. The response also includes any information that the client requested.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*avYiJx5j2UnFmXexlToixg.png" /></figure><p><strong>1 — HTTP Methods</strong></p><p>Request methods are the actions that the client wants to perform on the server resource. The most common methods are GET, POST, PUT, DELETE, others are: UPDATE, HEAD, CONNECT, OPTIONS, TRACE, PATCH.</p><ul><li>GET: retrieves the information from the server</li><li>POST: used to add a new object to the server resource.</li><li>PUT: used to update the existing object on the server resource.</li><li>DELETE: used to delete the object on the server resource.</li></ul><blockquote>More information: <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods">https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods</a></blockquote><h4>2 — HTTP Headers</h4><p>HTTP headers play a crucial role in how clients and servers send and receive data. They provide a structured way for these entities to communicate important metadata about the request or response. This metadata can contain various information like the type of data being sent, its length, how it’s compressed, and more.</p><p>Headers are logically grouped into three categories: request headers, response headers and general header. This can be seen in the network tab of the browser after sending the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*bD8Wb4q1xU7nNlwMa-ucCA.png" /><figcaption>You can find these categories of headers in network tab of the browser</figcaption></figure><p><strong>Request headers are:</strong></p><ol><li><em>Authorization</em>: request header can be used to provide credentials that authenticate a user agent with a server, allowing access to a protected resource.</li><li><em>Host</em>: this is the domain name of the server</li><li><em>Accept-Language</em>: request HTTP header indicates the natural language and locale that the client prefers.</li><li><em>Accept-Encoding</em>: request HTTP header indicates the content encoding (usually a compression algorithm) that the client can understand.</li><li><em>Content-Type</em>: this field tells the client the format of the data it’s receiving</li></ol><p><strong>Response headers:</strong></p><ol><li><em>Expires</em>: this header contains the date/time after which the response is considered expired.</li><li><em>Content-Length</em>: this field in the request or response header plays a crucial role in data transfer. It specifically indicates the size of the body of the request or response in bytes. This helps the receiver understand when the current message ends and potentially prepare for the next one, especially in cases where multiple HTTP messages are being sent over the same connection.</li><li><em>Content-Type</em>: this field tells the client the format of the data it’s receiving</li><li><em>Cache-Control: </em>HTTP header field holds directives (instructions) — in both requests and responses — that control caching in browsers and shared caches (e.g. Proxies, CDNs)</li><li><em>Date</em>: HTTP header contains the date and time at which the message originated.</li><li><em>Keep-Alive</em>: general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of request</li></ol><p><strong>General Headers:</strong></p><ol><li><em>Request URL</em></li><li><em>Request Method</em></li><li><em>Status Code</em></li><li><em>Remote Address</em></li><li><em>Connection</em></li></ol><blockquote>More information: <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers</a></blockquote><h4>3 — Request/Response Payload</h4><p>Request Body has a format to be followed, which is understood by the server resource or the service endpoint. Usually the response body is in JSON.</p><p><strong>What is JSON?</strong></p><p><strong><em>JSON (JavaScript Object Notation)</em></strong> is an open-standard file format or data interchange format that uses human-readable text to transmit data objects.</p><p>A JSON object contains data in the form of a key/value pair. The keys are strings and the values are the JSON types. Keys and values are separated by a colon. Each entry (key/value pair) is separated by a comma. The { (curly brace) represents the JSON object. An example of JSON is provided below.</p><pre>{<br>  &quot;First name&quot;: &quot;John&quot;,<br>  &quot;Age&quot;: 22,<br>  &quot;isMaried&quot;: false,<br>  &quot;Hobbies&quot;: [<br>    &quot;Netflix&quot;,<br>    &quot;mountain biking&quot;<br>  ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0u9u5V2hbfsi41xmekZElg.png" /></figure><h4>4 — URL</h4><p>A REST API is accessed with a URL. The URL consists of a base URL, resource, path variables and query parameters. The base URL is the internet host name for the REST API. Resources are presented as sets of endpoints grouped on the basis of related data or the object they allow working with.</p><p>Difference between query parameters and path variables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*C-vAANZxb1Ishouvxpkcbw.png" /><figcaption>The difference between path variables and query parameters</figcaption></figure><h4>5 — HTTP Status Codes</h4><p>The REST responses includes a status code that indicates whether the request was successful, and if not, the type of the error that occurred.</p><p>Response codes are grouped in various classes based on the characteristics of the response. The most common groupings are as follows (with several examples):</p><ol><li><strong><em>Informational — 1XX</em></strong></li></ol><p>100 — Continue: this interim response indicates that the client should continue the request or ignore the response if the request is already finished.</p><p><strong><em>2. Success — 2XX</em></strong></p><p>200 — OK: the request was successful</p><p>201 — Created: the request was successful , and one or more entities was created</p><p>204 No Content — request was processed successfully and no data returned</p><p><strong><em>3. Redirection — 3XX</em></strong></p><p>301 Moved Permanently — this response should include the new URI in the header so that the client will know where to point the request next time</p><p>304 — Not modified</p><p><strong><em>4. Client Error — 4XX</em></strong></p><p>400 — Bad Request: the request was not properly formed therefore was not successful</p><p>404 — Not Found: the URI path is incorrect, or communication with the server was unsuccessful</p><p>403 Forbidden — the client has the appropriate authentication to make the request but doesn’t have the permission to view the resource</p><p><strong><em>5. Server Error — 5XX</em></strong></p><p>503 — Service Unavailable: the responding server is temporarily down for some reason.</p><blockquote>More information: <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status">https://developer.mozilla.org/en-US/docs/Web/HTTP/Status</a></blockquote><h4>Conclusion</h4><p>We began by diving into the fundamental concepts, grasping the essence of Application Programming Interfaces.</p><p>Tracing their historical roots, we witnessed the evolutionary growth of APIs. From the early days of monolithic architectures to the rise of microservices, APIs have proven to be the backbone of seamless communication between various software components.</p><p>Furthermore, we explored the diverse types of protocols employed by APIs, including REST, SOAP, GraphQL, and more. Each protocol brings its unique strengths, ensuring that developers have the flexibility to choose the most suitable option for their projects.</p><p>Understanding the essential components of an API, such as endpoints, methods, headers, and payloads, has given us a deeper appreciation for the intricacies involved in API design and usage. These components act as the building blocks that facilitate data exchange, functionality integration, and ultimately, the seamless flow of information between different applications.</p><p>In the upcoming parts of this series, we will take a look at the world of API Testing. We will explore the best practices for testing APIs, the tools and frameworks available, and various testing methodologies to ensure the robustness, security, and efficiency of APIs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2bb9eceed0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Empowering UI Test Automation using AI: Brief Overview of Testim.io Capabilities]]></title>
            <link>https://qa-nora.medium.com/empowering-ui-test-automation-using-ai-brief-overview-of-testim-io-capabilities-7e54a41f8924?source=rss-5b22734b1e50------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e54a41f8924</guid>
            <category><![CDATA[testim]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[testing-tools]]></category>
            <dc:creator><![CDATA[Eleonora Belova ]]></dc:creator>
            <pubDate>Tue, 25 Jul 2023 15:27:54 GMT</pubDate>
            <atom:updated>2023-07-25T16:14:14.759Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0sPQDud2OfrILH27duA2w.jpeg" /><figcaption>Photo Credit: Google Images</figcaption></figure><h4>Introduction</h4><p>In today’s competitive landscape, software companies are heavily investing in enhancing user experience, refining their tools, incorporating DevOps practices, and leveraging automated procedures while adopting cloud infrastructure.</p><blockquote>However, there’s often a tendency to treat testing as an afterthought until it becomes clear that it’s a critical factor in delivering high-quality products and can even become a bottleneck in the product delivery process.</blockquote><p>For web applications, manual test cases can become challenging to perform and maintain, especially when the primary goal is to achieve fast deployment. This is where UI Automation emerges as a valuable solution, ensuring that the website functions correctly. Not only does UI Automation facilitate efficient testing during development, but it also proves invaluable for executing regression testing. By running automated tests, engineers can verify that any changes made to the code do not reintroduce previously resolved bugs.</p><p>By adopting a comprehensive testing strategy and incorporating UI Automation, companies can enjoy the benefits of faster and more reliable software deployments, enhanced user satisfaction, and increased confidence in the product’s overall quality.</p><h4>What are the challenges in UI Test Automation?</h4><p>There are <a href="https://shormistha4.medium.com/top-5-challenges-of-web-ui-testing-1db394304501">list of challenges</a> when it comes to UI Automation:</p><ul><li><strong>Complicated functionalities of UI Components</strong></li></ul><p>One of the significant challenges in UI Automation is dealing with complex UI components. Modern applications often have user interfaces with dynamic elements, making it difficult to accurately interact with and test these components. Handling such complexities requires well-developed automation scripts and constant updates as the UI evolves.</p><ul><li><strong>Changing locators/elements constantly</strong></li></ul><p>User interfaces are subject to frequent changes during the development process. UI elements’ locators may change due to updates, modifications, or redesigns. This makes the automation scripts reliant on specific element locators which is vulnerable to breakage, resulting in the need for regular maintenance.</p><ul><li><strong>Multiple Errors Handling</strong></li></ul><p>UI Automation can lead to various types of errors, such as element not found, timing issues, or synchronization problems. Dealing with these errors effectively in the automation framework is crucial to maintaining the reliability of the testing process.</p><ul><li><strong>Rapidly evolving testing tooling and technologies</strong></li></ul><p>The landscape of UI Automation tools and technologies is evolving rapidly, with new options constantly emerging. While this brings the advantage of improved reliability and efficiency, it can be challenging for teams to keep up with the latest trends and determine which tools are best suited for their specific testing needs.</p><h4>Available UI Test Automation Solutions On The Market</h4><p>If we start thinking about UI Testing Automation Solutions, Selenium is undoubtedly a powerful and widely used UI Automation tool with an extensive community and robust features. However, it also comes with certain drawbacks, such as:</p><ul><li><strong>Maintenance efforts</strong></li></ul><p>Selenium tests rely on a <em>single element locator </em>(for example, class, name, id, etc.). Changes to the application, especially those in elements’ identifiers will break Selenium tests. This stops releases in their tracks as teams try to diagnose failures, fix tests, and rerun them. It causes long time of maintenance.</p><ul><li><strong>Learning curve</strong></li></ul><p>Selenium’s powerful capabilities and flexibility in creating test cases can result in a steep learning curve, especially for newcomers to UI Automation. Investing significant time in mastering Selenium and its various features can be a challenge, particularly when teams are under pressure to deliver results quickly.</p><p><em>To address these challenges effectively, it is essential for teams to carefully choose their UI Automation tools, considering factors like ease of maintenance, robust error handling, and a balance between powerful features and simplicity.</em></p><p><em>Additionally, investing in continuous learning and skill development will enable testers to make the most of the available automation tools and technologies while ensuring efficient and effective UI testing.</em></p><h4>Testim.io Tool: How it helps teams to improve the testing process.</h4><p>There are some tools available on the market which can mitigate pain points of traditional tools like Selenium. By using AI powered tool it is possible to decrease time spent on maintenance and ensuring smooth and fast authoring of test cases.</p><p>One such remarkable example is <em>Testim.io</em>,<em> a cloud-based platform that empowers testers with efficient test case authoring, maintenance, and execution without the need for extensive coding expertise.</em></p><p>During last several month out team had exposure to this tool and we began utilizing it to enhance our test automation process. It allowed us significantly increasing the speed of software development and testing. Let me provide a brief overview of some key features and advantages that make Testim an effective addition to our testing arsenal.</p><p><strong><em>Here’s what Testim.io allows to do:</em></strong></p><ul><li><strong>Efficient Test Case Structure</strong></li></ul><p>Testim.io enables the creation of reusable test <a href="https://help.testim.io/docs/groups">groups</a>, <a href="https://help.testim.io/docs/shareable-steps">steps</a> and properties, ensuring a well-organized and maintainable test suite.</p><ul><li><strong>Fast Test Authoring</strong></li></ul><p>With its intuitive <a href="https://help.testim.io/docs/how-to-record-a-test">record feature</a>, Testim.io streamlines the process of creating test cases, saving valuable time and effort.</p><ul><li><strong>Built-in Conditions and Loops</strong></li></ul><p>Testim.io comes equipped with a variety of built-in <a href="https://help.testim.io/docs/conditions">conditions</a> and <a href="https://help.testim.io/docs/loops">loops</a>, allowing testers to validate elements’ visibility on the page, perform text validation, and execute various test scenarios.</p><ul><li><strong>Implementing Waits and Sleep</strong></li></ul><p>Testim.io offers flexibility in implementing <a href="https://help.testim.io/docs/wait-for">waits</a> and sleep commands to handle timing-related issues during test execution.</p><ul><li><strong>Organizing Test Suites</strong></li></ul><p>Testers can easily organize their test suites and set <a href="https://help.testim.io/docs/labels">labels</a>, ensuring better manageability and test case categorization.</p><ul><li><strong>Debugging Functions</strong></li></ul><p>Testim.io provides powerful <a href="https://help.testim.io/docs/debugging-overview">debugging functionalities</a>, including setting up breakpoints and playing tests using the user interface, aiding in identifying and resolving issues effectively.</p><ul><li><strong>Test Scheduling</strong></li></ul><p>Teams can <a href="https://help.testim.io/docs/scheduler">schedule</a> test runs conveniently, automating the testing process and saving time for other critical tasks.</p><ul><li><strong>Cross-Browser Testing</strong></li></ul><p>Testim.io supports different <a href="https://help.testim.io/docs/running-tests-on-multiple-browsers">web browsers</a>, allowing comprehensive testing across multiple platforms.</p><ul><li><strong>Flexibility in leveraging the power of creating custom action using Javascript</strong></li></ul><p>Testim.io provides flexibility in building <a href="https://help.testim.io/docs/custom-code">custom steps</a> using programming language.</p><ul><li><strong>Smooth Integration with other tools</strong></li></ul><p>It is possible to integrate Testim.io suites with <a href="https://help.testim.io/docs/integrate-testim-to-your-ci">CI/CD Solutions</a> (Jenkins, TeamCity, Bamboo, GitLab, GitHub and others), <a href="https://help.testim.io/docs/test-management-integrations">Test Management tools</a> (TestRail, qTest, TTM), Jira, Slack, and more.</p><p>One of Testim.io’s most significant advantages is its <em>embedded self-healing mechanism</em>, setting it apart from Selenium. By assigning self-healing smart locators to identify and find each web element, Testim adapts to page changes automatically. This means that if an element becomes difficult to locate due to UI changes, Testim evaluates the tests and automatically improves them before they break. This self-healing capability makes tests tolerant to non-functional UI changes, significantly reducing maintenance efforts and ensuring robust test stability.</p><p>In conclusion, Testim.io stands as an efficient AI-powered tool that streamlines test automation, making test case creation, maintenance, and execution faster, more reliable, and accessible to testers with varying levels of programming expertise. Its self-healing mechanism ensures that tests remain resilient to UI changes, saving valuable time and resources. As a result, Testim.io empowers software teams to focus more on delivering high-quality products and less on the burdens of test maintenance.</p><h4>Testim.io Tool: How to start?</h4><p>If you’re not yet familiar with Testim.io and its capabilities, I highly recommend creating a free account and exploring its features by trying out various scenarios. You can begin by creating a simple test case, validating text and elements, and even building custom JavaScript actions.</p><p>To get started with the tool, there is an <a href="https://www.youtube.com/watch?v=3YNhYhXWMsY">informative video</a> and <a href="https://help.testim.io/docs">official documentation</a> available that you can help you with a better understanding of Testim.io’s functionalities and how to effectively utilize them in your testing process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e54a41f8924" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>