<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Phoebe M</title>
    <description>The latest articles on Forem by Phoebe M (@awkwardblkcoder).</description>
    <link>https://forem.com/awkwardblkcoder</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F46981%2Fbaeb30e2-75b7-4b56-9b50-fe143f4c033e.jpg</url>
      <title>Forem: Phoebe M</title>
      <link>https://forem.com/awkwardblkcoder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/awkwardblkcoder"/>
    <language>en</language>
    <item>
      <title>Frontend Mentor - Job listings with filtering solution using Vue.js and Fetch API</title>
      <dc:creator>Phoebe M</dc:creator>
      <pubDate>Mon, 27 Nov 2023 02:23:19 +0000</pubDate>
      <link>https://forem.com/awkwardblkcoder/frontend-mentor-job-listings-with-filtering-solution-using-vuejs-and-fetch-api-a7j</link>
      <guid>https://forem.com/awkwardblkcoder/frontend-mentor-job-listings-with-filtering-solution-using-vuejs-and-fetch-api-a7j</guid>
      <description>&lt;p&gt;This is a solution to the &lt;a href="https://www.frontendmentor.io/challenges/job-listings-with-filtering-ivstIPCt" rel="noopener noreferrer"&gt;Job listings with filtering challenge on Frontend Mentor&lt;/a&gt;. Have you completed this challenge? What was your solution?&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
Job listings with filtering solution using Vue.js and Fetch API

&lt;ul&gt;
&lt;li&gt;Table of contents&lt;/li&gt;
&lt;li&gt;Overview&lt;/li&gt;
&lt;li&gt;The challenge&lt;/li&gt;
&lt;li&gt;Links&lt;/li&gt;
&lt;li&gt;My process&lt;/li&gt;
&lt;li&gt;Built with&lt;/li&gt;
&lt;li&gt;My Solution (In-Depth)&lt;/li&gt;
&lt;li&gt;What I Learned&lt;/li&gt;
&lt;li&gt;Useful resources&lt;/li&gt;
&lt;li&gt;Author&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The challenge
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F009j267xcc44g1k5arm5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F009j267xcc44g1k5arm5.png" alt="Desktop Layout View"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Users should be able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;View the optimal layout for the site depending on their device's screen size&lt;/li&gt;
&lt;li&gt;See hover states for all interactive elements on the page&lt;/li&gt;
&lt;li&gt;Filter job listings based on the categories&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Solution: &lt;a href="https://github.com/phoebe-michel/static-job-listings-master" rel="noopener noreferrer"&gt;Click to view&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Live Site: &lt;a href="https://phoebe-michel.github.io/static-job-listings-master/" rel="noopener noreferrer"&gt;Click to view&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My process
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Built with
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Semantic HTML5 markup&lt;/li&gt;
&lt;li&gt;CSS custom properties&lt;/li&gt;
&lt;li&gt;Flexbox&lt;/li&gt;
&lt;li&gt;CSS Grid&lt;/li&gt;
&lt;li&gt;Mobile-first workflow&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;Vue.js&lt;/a&gt; - JS library&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  My Solution (In-Depth)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Using the JavaScript Fetch API, I loaded the job listing data and saved it to an array, &lt;code&gt;jobList&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;loadDataFromJson&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./data.json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jobList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The visibility of the filter bar is based on the length of the array, &lt;code&gt;jobFilters&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"job-list-filter"&lt;/span&gt; &lt;span class="na"&gt;v-show=&lt;/span&gt;&lt;span class="s"&gt;"jobFilters.length&amp;gt;0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; 
    ...
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On initial load, the &lt;code&gt;jobFilters&lt;/code&gt; array is empty and, as a result, the filter bar is hidden. When a user clicks on the filter tabs on the right side of each job listing, the addFilter() method is invoked which checks to see if the filter already exists in &lt;code&gt;jobFilters&lt;/code&gt;. If not, the value is stored in the array and the filter bar becomes visible.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;addFilter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;filterExists&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jobFilters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;filterExists&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jobFilters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The jobList is rendered to the webpage using a computed property, &lt;code&gt;filteredJobList&lt;/code&gt;. On initial load, all job listings are rendered since the user hasn't clicked on any filters yet. However, when the user clicks on a filter, the program uses the array methods, &lt;code&gt;.filter()&lt;/code&gt; and &lt;code&gt;.every()&lt;/code&gt;, to loop through &lt;code&gt;jobList&lt;/code&gt; and display only the jobs that match the filters in &lt;code&gt;jobFilters&lt;/code&gt; array.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;filteredJobList&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jobList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;level&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;filters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jobFilters&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;filters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;p&gt;This challenge was a great way to refamiliarize myself with array helper methods such as &lt;code&gt;.every()&lt;/code&gt;, and with using the Fetch API. I was also able to use CSS Grid and FlexBox to get the desired layout, which is always fun.&lt;/p&gt;

&lt;h3&gt;
  
  
  Useful resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.javascripttutorial.net/web-apis/javascript-fetch-api/" rel="noopener noreferrer"&gt;JavaScript Tutorial - JavaScript Fetch API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learncssgrid.com/" rel="noopener noreferrer"&gt;Learn CSS Grid&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="noopener noreferrer"&gt;A Complete Guide to CSS Flexbox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" rel="noopener noreferrer"&gt;MDN Web Docs - Array&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Author
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Website - &lt;a href="https://github.com/phoebe-michel" rel="noopener noreferrer"&gt;Phoebe Michel&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Frontend Mentor - &lt;a href="https://www.frontendmentor.io/profile/awkwardblackcoder" rel="noopener noreferrer"&gt;@awkwardblackcoder&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>vue</category>
      <category>frontend</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>A Beginner's Guide to Writing End-to-End Tests with TestCafe</title>
      <dc:creator>Phoebe M</dc:creator>
      <pubDate>Wed, 04 Mar 2020 18:12:30 +0000</pubDate>
      <link>https://forem.com/awkwardblkcoder/a-beginner-s-guide-to-writing-end-to-end-tests-with-testcafe-chc</link>
      <guid>https://forem.com/awkwardblkcoder/a-beginner-s-guide-to-writing-end-to-end-tests-with-testcafe-chc</guid>
      <description>&lt;p&gt;Lately, with the planning of a new application launch, I'm learning all the aspects needed to design/develop an application, which isn't just coding and styling it. Yes, your application may look great when you're done, but can you imagine what will happen if any one component of a major system fails or if an issue goes undetected? This is where the importance of End-to-End testing(in addition to a series of other tests, of course) comes in. &lt;/p&gt;

&lt;h2&gt;What is End-to-End testing?&lt;/h2&gt;

&lt;p&gt;End-to-end testing is a method used to check whether your application is behaving exactly how it's supposed to as a whole from start to finish. Through this technique, you are testing all of the important functionalities of your product, such as how well it is communicating with other databases, networks, and applications. &lt;/p&gt;




&lt;p&gt;In this post, I will go over the following:&lt;/p&gt;
  

&lt;ul&gt;
&lt;li&gt;What is TestCafe&lt;/li&gt;
  
&lt;li&gt;How to Install TestCafe&lt;/li&gt;
  
&lt;li&gt;Writing and running your first test script&lt;/li&gt;
&lt;/ul&gt;




  &lt;h2&gt;What is TestCafe?&lt;/h2&gt;

&lt;p&gt;TestCafe is a new, open-source, Node.js-based end-to-end testing tool used to automate testing for web apps. It takes care of all testing stages: starting browsers, running tests, gathering test results and generating reports. Using TestCafe for end-to-end testing has many advantages: 

&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It is easy to install&lt;/li&gt;
&lt;li&gt;It all supports all browsers and their versions&lt;/li&gt;
&lt;li&gt;It doesn't need any plugins or has any dependencies; it works &lt;em&gt;right out of the box&lt;/em&gt;, without you having to install any other software or web drivers.&lt;/li&gt;

&lt;/ol&gt;




&lt;h2&gt;Installing TestCafe &lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;First things first, because TestCafe is JavaScript/Node.js-based, you need to install node.js to your system. If you already have it installed, you should be able to install packages using the npm command.&lt;/li&gt;

&lt;li&gt;Now, all you have to do to install testcafe is to run this command globally in your terminal:

&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cisNoSYy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/j9vfb88vh1mmntlph9kq.png"&gt;

&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;Writing Tests&lt;/h2&gt;

&lt;p&gt;To practice writing tests, we will be using TestCafe demo page.

&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;Create a directory to house your test files. I'll name mine 'TestCafe-Example'.&lt;/li&gt;

&lt;li&gt;Open a code editor of your choice and open up your newly created folder. (I use VSCode as my editor) &lt;/li&gt;

&lt;li&gt;Create a new file called 'app.test.js' in your directory.&lt;/li&gt;


&lt;p&gt;Now that you have your test file created, time to add in the code.&lt;/p&gt;

&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Import the testcafe module&lt;strong&gt;

&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GLtoHyE3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1xb9vpcq7lucx1q97z2j.png"&gt;
&lt;/strong&gt;&lt;/strong&gt;&lt;/li&gt;
   
&lt;li&gt;
&lt;strong&gt;Create a fixture. &lt;/strong&gt;
   
&lt;p&gt;A fixture is a category of tests used to make our tests cleaner and readable. A test suite can contain one or more fixtures. To declare a test fixture, use the fixture function:&lt;/p&gt;
fixture(fixtureName) &lt;em&gt;or&lt;/em&gt; fixture `fixtureName`

&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ylxoae3f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dizvfycgqx0svvwzq0hz.png"&gt;
Note: The fixture declaration can be used to specify the target webpage
&lt;/li&gt;


&lt;li&gt;
&lt;strong&gt;Add a test.&lt;/strong&gt;
   
    &lt;p&gt;To initiate a test, call the test function and pass the test code inside it. &lt;/p&gt;
&lt;p&gt;test(testName, fn(t))&lt;/p&gt;

&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J7seKuMT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wkwlu4a8vauvlcrpz8ak.png"&gt;

&lt;p&gt;In the above code sample, the test will type text into the 'Developer Name' input element and click the Submit button. The submit button will redirect you to a page that says 'Thank You, %username%!'(Feel free to change the text in the input element to whatever you like!)&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;'t'&lt;/strong&gt; object represents the test controller used to access the test run API's methods. You can use the test controller to:&lt;/p&gt;

&lt;ul&gt;    
&lt;li&gt;call the test actions&lt;/li&gt;
&lt;li&gt;handle browser dialog&lt;/li&gt;
&lt;li&gt;use the wait function, and&lt;/li&gt;
&lt;li&gt;execute assertions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To check that the text on the page contains the right name, we'll create a selector that locates the article header and adds an assertion that checks that the text says 'Thank you, Phoebe M.' (or whatever name you replaced mine with 😊)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2p7A4vS9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n1w9o2xsyn9g0x6dgvtk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2p7A4vS9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n1w9o2xsyn9g0x6dgvtk.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to test it! If running on a local machine, simply run this command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1V0pheVJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mqdjqv9zcmy7nm1umxx0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1V0pheVJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mqdjqv9zcmy7nm1umxx0.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this command, TestCafe will find and launch Google Chrome to run the test. Of course, if you're using a different browser or you named your test file something differently, feel free to update the command accordingly. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; To see a list of browsers that TestCafe detects on your machine, run the following command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iUPc5T1x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/y6500cauz9c3nvrg6qnv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iUPc5T1x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/y6500cauz9c3nvrg6qnv.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's it! The simplest way to write and run an end to end test script. &lt;/p&gt;




&lt;h3&gt;&lt;u&gt;Resources&lt;/u&gt;&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.tutorialspoint.com/software_testing_dictionary/end_to_end_testing.htm"&gt;TutorialsPoint - End-to-End Testing&lt;/a&gt;&lt;br&gt;
&lt;a href="https://testcafe.devexpress.com/Documentation/Getting_Started/Getting_Started_Guide/#Setting_up_a_test_project"&gt;TestCafe - Getting Started Guide&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.sitepoint.com/testcafe-easier-end-end-web-app-testing-node-js/"&gt;SitePoint&lt;/a&gt;&lt;br&gt;
&lt;a href="https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html"&gt;DevExpress - TestCafe Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>endtoendtesting</category>
      <category>webdev</category>
      <category>testing</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
