<?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: Eakam</title>
    <description>The latest articles on Forem by Eakam (@eakam).</description>
    <link>https://forem.com/eakam</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%2F922744%2Fb49db44d-f564-4eb3-a629-383ade26e272.png</url>
      <title>Forem: Eakam</title>
      <link>https://forem.com/eakam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/eakam"/>
    <language>en</language>
    <item>
      <title>Starchart - Milestone 1.0a</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Wed, 19 Apr 2023 02:59:17 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-milestone-10a-g6h</link>
      <guid>https://forem.com/eakam/starchart-milestone-10a-g6h</guid>
      <description>&lt;p&gt;Last week, I worked on a bunch of things for our 1.0a (alpha) release:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adding end-to-end tests for DNS Records&lt;/strong&gt; &lt;br&gt;
We were missing a large amount of tests for the DNS Records page. This included checking for different types and values of DNS Records when creation so that only valid values for different types can be created. It also included checking that all values were saved properly, checking edit functionality and delete functionality (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/576"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Preparing for Remix v2&lt;/strong&gt; &lt;br&gt;
This was to deal with multiple depreciation warnings as some of the remix specific stuff such as routes, meta tags, &lt;code&gt;ErrorBoundry&lt;/code&gt; and &lt;code&gt;CatchBoundry&lt;/code&gt;, and the &lt;code&gt;formMethod&lt;/code&gt; will &lt;a href="https://remix.run/docs/en/main/pages/v2"&gt;change in v2&lt;/a&gt;. Therefore, we decided to update to the new methods (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/614"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improving DNS Records table responsiveness&lt;/strong&gt; &lt;br&gt;
The DNS Records table does not look good on small screens. This was to create a better layout for mobile screens. Further PRs would be created to tackle the view for tablet screens and other screen sizes. I basically ended up using Chakra UI's &lt;code&gt;Show&lt;/code&gt; and &lt;code&gt;Hide&lt;/code&gt; components to use a different layout on mobile (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/619"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Small fixes for some test flakiness (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/620"&gt;PR&lt;/a&gt;), and adding a missing &lt;code&gt;*&lt;/code&gt; in emails (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/556"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Starchart: Milestone 0.9</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Mon, 10 Apr 2023 04:37:24 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-milestone-09-3432</link>
      <guid>https://forem.com/eakam/starchart-milestone-09-3432</guid>
      <description>&lt;p&gt;Last week, I worked on a bunch of bug fixes and features for starchart:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Splitting certificate public key from its chain. The certificate creation process returns the public key for the certificate, and a chain which contains the intermediate certificates. We were storing both of these in the same field, and displaying the data as is. Thus, users would be copying the public key + the chain instead of just the public key (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/532"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adding admin login setup for e2e tests. We have a util function that allows anyone writing tests to easily log in as a user. This needed to be extended to users with the admin role (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/531"&gt;PR&lt;/a&gt;)  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Improved landing page responsiveness. We had a couple of cards on the landing page that would shrink horizontally instead of moving to be vertically stacked on smaller screens (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/522"&gt;PR&lt;/a&gt;)  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Making links more obvious. We had a bunch of links that looked the exact same as rest of the text. This changed all links to have color red and an underline by default. Since we use Chakra UI, this was specified in the theme file, and thus could be overridden as you would for the base Chakra UI element (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/544"&gt;PR&lt;/a&gt;) :&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;extendTheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;breakpoints&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;Link&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;defineStyleConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;baseStyle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;brand.500&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;textDecor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;underline&lt;/span&gt;&lt;span class="dl"&gt;'&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="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nx"&gt;withDefaultColorScheme&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;colorScheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;brand&lt;/span&gt;&lt;span class="dl"&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;Removed happy-dom. I looked at a dependabot PR to update this package and noticed that we were not using it at all (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/520"&gt;PR&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Starchart: Milestone 0.8</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Mon, 03 Apr 2023 11:03:34 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-milestone-08-2pb6</link>
      <guid>https://forem.com/eakam/starchart-milestone-08-2pb6</guid>
      <description>&lt;p&gt;The last week I worked on some additional features for starchart, which are summarized below:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixing DNS Record expiry date - &lt;a href="https://github.com/DevelopingSpace/starchart/pull/457"&gt;PR&lt;/a&gt;. The expiry date was always set to July, and thus you could end up with a record created in December which expires in July.&lt;/li&gt;
&lt;li&gt;Adding checks for deactivated users - &lt;a href="https://github.com/DevelopingSpace/starchart/pull/487"&gt;PR&lt;/a&gt;. This was needed as we don't want to allow deactivated users (users who are being deleted) to perform any actions. Most of the work here involved looking at the routes and actions, and adding checks where needed but it ended up being a small change.&lt;/li&gt;
&lt;li&gt;Attempting to add coverage report for playwright e2e tests - &lt;a href="https://github.com/DevelopingSpace/starchart/issues/420"&gt;Issue&lt;/a&gt;. This issue was created after adding coverage report for unit tests which use Vitest. Playwright does not have a coverage option but we found a possible npm module that could be used for this - &lt;a href="https://www.npmjs.com/package/playwright-test-coverage"&gt;playwright-test-coverage&lt;/a&gt;. However, after some research, I found that the module requires &lt;a href="https://github.com/istanbuljs/babel-plugin-istanbul"&gt;babel-plugin-istanbul&lt;/a&gt;. Since we use remix, we decided that it was not worth the effort to try to add babel plugins to remix as it would risk causing new problems.
Apart from this, I spent some time reviewing PRs. You can find the 
changelog &lt;a href="https://github.com/DevelopingSpace/starchart/releases/tag/v0.8.0"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Starchart: Milestone 0.7</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Mon, 27 Mar 2023 02:37:23 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-milestone-07-2m1f</link>
      <guid>https://forem.com/eakam/starchart-milestone-07-2m1f</guid>
      <description>&lt;p&gt;This past week, I worked on a bunch of small issues for starchart to improve our UI experience, fix some bugs, and update test configuration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We needed some new scripts to setup a test database to use when running automated tests. This basically involved copying the existing setup script and changing the database url (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/398/files"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some updates were needed for our vitest configuration. These were mostly small changes, and also another script to add a coverage report for unit tests. This also raised some discussion on &lt;a href="https://github.com/DevelopingSpace/starchart/issues/420"&gt;adding coverage for out end to end tests&lt;/a&gt;. (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/410"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A UI change to hide the DNS Records table if none exist for the logged in user. Instead, a create button is displayed in the center. (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/429"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Another UI for the DNS Records table to disable the renew record button if the DNS record expiry date 6 months from now or beyond. (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/431"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A change to improve the accessibility of some links on the landing page. This was needed as the light blue color didn't provide enough contrast. (&lt;a href="https://github.com/DevelopingSpace/starchart/pull/430"&gt;PR&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another issue that I have been working on but was not able to finish the last week is to handle the fact that &lt;a href="https://github.com/DevelopingSpace/starchart/issues/394"&gt;users can be deactivated&lt;/a&gt;. This involves checking for a user being deactivated in multiple places throughout the code as a user could be deactivated while a some jobs are running to update  DNS Records, etc.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Starchart: Playwright tests separation</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Mon, 20 Mar 2023 03:08:37 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-playwright-tests-separation-2ea3</link>
      <guid>https://forem.com/eakam/starchart-playwright-tests-separation-2ea3</guid>
      <description>&lt;p&gt;The past week, I continued working on different issues in starchart. This involved &lt;a href="https://github.com/DevelopingSpace/starchart/pull/367"&gt;adding a deactivated flag to users&lt;/a&gt;, which was a fairly simple change. This is required as we want to allow admin users to delete users. However, before a user can be deleted, we need to queue up deletion of any DNS records or certificates associated with that user. &lt;br&gt;
This process can take some time, and we needed a way to prevent the user from creating any new DNS records or certificates while they are being deleted. Thus, we decided to add a deactivated flag to users and if this flag is true, they will not be able to perform any actions.&lt;/p&gt;

&lt;p&gt;Another issue I worked on was to &lt;a href="https://github.com/DevelopingSpace/starchart/pull/354"&gt;improve our documentation about Playwright&lt;/a&gt;, and more specifically, our configuration and how to use the automated report we generate after a CI run to debug any failing tests (&lt;a href="https://github.com/DevelopingSpace/starchart/wiki/Playwright"&gt;wiki page&lt;/a&gt;).&lt;br&gt;
While working on this documentation, I also worked with &lt;a href="https://github.com/Ririio"&gt;Ririio&lt;/a&gt; with his work on &lt;a href="https://github.com/DevelopingSpace/starchart/pull/365"&gt;improving our e2e test coverage for various pages&lt;/a&gt;. We ran into an issue while testing the header as the links in the header move into a hamburger menu on mobile viewports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Desktop View:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3QSrfb87--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lihba3nr3b9bpi4tl1h1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3QSrfb87--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lihba3nr3b9bpi4tl1h1.png" alt="Desktop header view" width="880" height="189"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mobile View:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qa7dROZL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/knwq211j3l75irkzoxgt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qa7dROZL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/knwq211j3l75irkzoxgt.png" alt="Mobile header view" width="440" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thus, as our playwright config ran the same test file for several browsers, including mobile view ports we would either have failing tests for desktop or failing tests for mobile. &lt;/p&gt;

&lt;p&gt;An option was to skip tests if we were on a mobile viewport. However, &lt;a href="https://github.com/microsoft/playwright/issues/11812#issuecomment-1462829766"&gt;due to an issue with mobile safari configuration&lt;/a&gt;, where it fails on GitHub Actions but passes on Windows (where I was able to test), we had to override the configuration's &lt;code&gt;isMobile&lt;/code&gt; property to &lt;code&gt;false&lt;/code&gt; as a workaround. So, this would not work. Even then, we would need to add a &lt;code&gt;test.skip&lt;/code&gt; to every test we wanted to skip for mobile, and then add another test to only run on mobile.&lt;/p&gt;

&lt;p&gt;After some discussion, we decided to use the &lt;a href="https://playwright.dev/docs/api/class-testconfig#test-config-test-ignore"&gt;&lt;code&gt;testIgnore&lt;/code&gt;&lt;/a&gt; property in the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;projects&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="c1"&gt;// Desktop projects&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="nx"&gt;testIgnore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mobile&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;spec&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;&lt;span class="o"&gt;/&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="c1"&gt;// Mobile projects&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="nx"&gt;testIgnore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;desktop&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;spec&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;&lt;span class="o"&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;p&gt;We added mobile specific tests in files ending with &lt;code&gt;.mobile.spec.ts&lt;/code&gt; (eg: &lt;code&gt;header.mobile.spec.ts&lt;/code&gt;), and desktop specific tests in files ending with &lt;code&gt;.desktop.spec.ts&lt;/code&gt; (eg: &lt;code&gt;header.desktop.spec.ts&lt;/code&gt;). Any common tests would still go in the usual file (eg: &lt;code&gt;header.spec.ts&lt;/code&gt;). &lt;br&gt;
This works as playwright has a &lt;a href="https://playwright.dev/docs/api/class-testconfig#test-config-test-match"&gt;&lt;code&gt;testMatch&lt;/code&gt;&lt;/a&gt; property which by default matches all files using the regex &lt;code&gt;.*(test|spec)\.(js|ts|mjs)&lt;/code&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Starchart: Shared sessions in Playwright</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Mon, 13 Mar 2023 10:14:12 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-shared-sessions-in-playwright-2034</link>
      <guid>https://forem.com/eakam/starchart-shared-sessions-in-playwright-2034</guid>
      <description>&lt;p&gt;Last week, I worked on &lt;a href="https://github.com/DevelopingSpace/starchart/issues/296"&gt;setting up shared authentication for end-to-end Playwright tests in starchart&lt;/a&gt;. This was necessary to avoid having to login before every test. The &lt;a href="https://playwright.dev/docs/auth"&gt;Playwright docs&lt;/a&gt; suggest a few different ways of doing this, such as a shared account for all tests, or setting up multiple roles. &lt;/p&gt;

&lt;p&gt;I went with a similar setup to the setup you would have for multiple roles with a shared account across all tests that require login. Currently, all the pages do not differentiate between roles, i.e., they do not show different things based on the role. However, a design for an admin dashboard was being worked on, and will be implemented in the upcoming weeks. So, I decided to use a setup that would be easy to expand for different roles such as an &lt;code&gt;admin&lt;/code&gt; user.&lt;/p&gt;

&lt;p&gt;I started by adding a setup file under my e2e tests folder which would go through the login process, and save the authenticated state in a file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;setup&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@playwright/test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userFile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test/e2e/.auth/user.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;authenticate as user&lt;/span&gt;&lt;span class="dl"&gt;'&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;page&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="p"&gt;...&lt;/span&gt;
  &lt;span class="c1"&gt;// Login steps&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;storageState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;userFile&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;p&gt;Then I modified playwright config and added a new project that will be a dependency of all other projects. A project has a name and defines configuration for running the tests on a specific device in this case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;projects&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;setup&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;testMatch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sr"&gt;/.*&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="sr"&gt;setup&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="sr"&gt;ts/&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;...,&lt;/span&gt;
    &lt;span class="na"&gt;use&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="nx"&gt;devices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Desktop Chrome&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;setup&lt;/span&gt;&lt;span class="dl"&gt;'&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="nx"&gt;other&lt;/span&gt; &lt;span class="nx"&gt;projects&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By setting setup as a dependency, it will be run before the tests in the project are run. &lt;code&gt;testMatch&lt;/code&gt; defines a regex for the setup file(s), and it matches paths relative to the test directory defined in the config.&lt;/p&gt;

&lt;p&gt;Since the setup process is run before the tests are run, we actually don't need to commit our file with the saved session to git. Thus, I added it to the &lt;code&gt;.gitignore&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;I also &lt;a href="https://github.com/DevelopingSpace/starchart/pull/313"&gt;added tests for the &lt;code&gt;New DNS Record form&lt;/code&gt;&lt;/a&gt;. This form is used by a user to create a new &lt;code&gt;DNS Record&lt;/code&gt;. Since this required a user to be logged in, we can use the saved session state generated in the &lt;code&gt;setup&lt;/code&gt; project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;authenticated as user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&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="nx"&gt;loggedInAsUser&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;loggedInAsUser()&lt;/code&gt; is a util function that was added based on PR reviews:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;loggedInAsUser&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="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;storageState&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test/e2e/.auth/user.json&lt;/span&gt;&lt;span class="dl"&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;p&gt;&lt;code&gt;test.use&lt;/code&gt; can be specified in a &lt;code&gt;describe&lt;/code&gt; block or in a test file. It is not necessary to use this in a &lt;code&gt;beforeEach&lt;/code&gt; or &lt;code&gt;beforeAll&lt;/code&gt;, and doing so would result in an error.&lt;/p&gt;

&lt;p&gt;I ran the tests locally, and they all passed. However, I encountered a strange error in CI (which uses GitHub Actions) for the &lt;code&gt;Mobile Safari&lt;/code&gt; project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Test timeout of 30000ms exceeded.

page.goto: Navigation failed because page was closed!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Playwright generates a report containing a video and a trace on the first retry, depending on the configuration. I looked at the video and saw that most of it was a blank black screen. After trying a bunch of things such as upgrading playwright, and commenting out all other projects, I found &lt;a href="https://github.com/microsoft/playwright/issues/11812"&gt;this open issue on the playwright project&lt;/a&gt;. There was a &lt;a href="https://www.github.com/microsoft/playwright/issues/11812#issuecomment-1462829766"&gt;super helpful comment&lt;/a&gt; left on the issue with a temporary workaround. Basically, setting &lt;code&gt;isMobile&lt;/code&gt; to false for the &lt;code&gt;iPhone&lt;/code&gt; configuration used by the &lt;code&gt;Mobile Safari&lt;/code&gt; project results in the CI passing on GitHub actions.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Starchart: Week 7</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Sat, 04 Mar 2023 05:25:10 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-week-7-3afl</link>
      <guid>https://forem.com/eakam/starchart-week-7-3afl</guid>
      <description>&lt;p&gt;For week 7, I continued with my work on the &lt;a href="https://github.com/DevelopingSpace/starchart/pull/243"&gt;DNS Record creation page&lt;/a&gt;. This basically involved resolving all the review comments, and trying to get tests working. However, I ran into another sign in problem in the Playwright test environment:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IIGtfGMF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eh12fdw0d7ywhycdbbh4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IIGtfGMF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eh12fdw0d7ywhycdbbh4.png" alt="Metadata not found" width="880" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I did not want to resolve this specific issue in the same PR as the one creating the page so I decided to create a &lt;a href="https://github.com/DevelopingSpace/starchart/issues/278"&gt;separate issue&lt;/a&gt; for it.&lt;/p&gt;

&lt;p&gt;While working on the DNS Record creation page, I rebased my branch with the main branch as it had gotten out of date. After this, I found that I could no longer run the app, and got this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'SECRETS_OVERRIDE' is not recognized as an internal or external
command, operable program or batch file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I saw that the &lt;code&gt;dev&lt;/code&gt; script had been modified to override an ENV variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SECRETS_OVERRIDE=1 run-p dev:*"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, this syntax is not supported on Windows. So, I created a &lt;a href="https://github.com/DevelopingSpace/starchart/pull/267"&gt;PR&lt;/a&gt; to use &lt;a href="https://www.npmjs.com/package/cross-env"&gt;&lt;code&gt;cross_env&lt;/code&gt;&lt;/a&gt; so it would also work on windows.&lt;/p&gt;

&lt;p&gt;After addressing all the comments on my original PR (to create the new page UI), I helped &lt;a href="https://github.com/Genne23v"&gt;Genne23v&lt;/a&gt; resolve CI failure on &lt;a href="https://github.com/DevelopingSpace/starchart/pull/274"&gt;this PR&lt;/a&gt;. New code had been added that would check for an ENV variable value and crash if the environment was &lt;code&gt;production&lt;/code&gt; and no value was specified. However, this should not have affected the end to end tests as the environment there was set to &lt;code&gt;testing&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"start:e2e"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cross-env NODE_ENV=testing node --require
dotenv/config ./build/server.js"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script starts the app when end to end tests are run. However, after some investigation and through &lt;a href="https://github.com/remix-run/remix/issues/2399"&gt;this discussion&lt;/a&gt;, I found that there were two problems with this approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;testing&lt;/code&gt; is not a valid value for &lt;code&gt;NODE_ENV&lt;/code&gt;. Providing &lt;code&gt;testing&lt;/code&gt; will result in &lt;code&gt;NODE_ENV&lt;/code&gt; being set to &lt;code&gt;production&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;During the build process, all calls to &lt;code&gt;process.env.NODE_ENV&lt;/code&gt; in the code are replaced with the actual value for &lt;code&gt;NODE_ENV&lt;/code&gt;. Thus, something like &lt;code&gt;console.log(process.env.NODE_ENV)&lt;/code&gt; would become &lt;code&gt;console.log("production")&lt;/code&gt;. This was done by the following script. Here, no value for &lt;code&gt;NODE_ENV&lt;/code&gt; is given, and therefore &lt;code&gt;production&lt;/code&gt; is assumed by default.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"pretest:e2e:run"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cross-env SECRETS_OVERRIDE=1 run-s build"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moving the override to this script and changing the value to &lt;code&gt;test&lt;/code&gt; resulted in the CI passing again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"pretest:e2e:run"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cross-env NODE_ENV=test SECRETS_OVERRIDE=1
run-s build"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More information about this process can be found in &lt;a href="https://github.com/DevelopingSpace/starchart/pull/274#discussion_r1117935006"&gt;this discussion&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Starchart: Record Creation Page</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Mon, 20 Feb 2023 05:05:30 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-record-creation-page-39l2</link>
      <guid>https://forem.com/eakam/starchart-record-creation-page-39l2</guid>
      <description>&lt;p&gt;The past week, I have been working on creating the &lt;a href="https://github.com/DevelopingSpace/starchart/issues/48"&gt;record creation page UI&lt;/a&gt;. This involves creating a form component that will be reused on this and the edit record page. A record has a name, type (A/AAAA/CNAME/TXT), value, and some other fields such as ports, course, and description, which provide context to the use of this record. &lt;br&gt;
Originally, this page was called a domain creation page as mentioned in the issue. However, after some &lt;a href="https://github.com/DevelopingSpace/starchart/pull/243#issuecomment-1436136836"&gt;discussion&lt;/a&gt; on the &lt;a href="https://github.com/DevelopingSpace/starchart/pull/243"&gt;PR&lt;/a&gt;, it was decided that it should really be called the record creation page&lt;/p&gt;

&lt;p&gt;When I started creating this page, I wanted to make it responsive for all screen sizes. Since we are using Chakra UI for our page designs, this was pretty simply to do. It is possible to pass an array of values to a Chakra UI component prop for different screen sizes. For example, the following code changes the margin on the left based at different breakpoints (&lt;a href="https://chakra-ui.com/docs/styled-system/responsive-styles"&gt;more details here&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Container&lt;/span&gt; &lt;span class="nx"&gt;maxW&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;container.xl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;ml&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{[&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;10vw&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures that there is no margin on the left for smaller screens but keeps the margin on larger screens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Large screens&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ib-SPGCk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1lt6c4dmeipkp7915tq9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ib-SPGCk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1lt6c4dmeipkp7915tq9.png" alt="margin on larger screens" width="768" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Small screens&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SLd8p0_D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z8hxvbz3aqdbd864jeoh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SLd8p0_D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z8hxvbz3aqdbd864jeoh.png" alt="no margin on smaller screens" width="641" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While Chakra UI's way to styling elements is really nice, I found that for some elements, I was repeating the same styles way too many times. For instance, these tooltip icons, which are used multiple times throughout the page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Tooltip&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;InfoIcon&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#d9d9d9&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;fontSize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;xl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Tooltip&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While I could create another component for this, I found that it was possible to override global styles for specific elements using Chakra UI themes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;extendTheme&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="na"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;global&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.domain-form&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="c1"&gt;// InfoIcon&lt;/span&gt;
          &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.chakra-icon&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#d9d9d9&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;xl&lt;/span&gt;&lt;span class="dl"&gt;'&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="p"&gt;},&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="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I found this a better alternative to copying the same styles all over the file, and without overriding the styles for that icon for all pages.&lt;/p&gt;

&lt;p&gt;After finishing the form, I decided to write some end to end tests using Playwright for the form behavior. This was to test if the page redirected to the edit page after a record was created. The e2e test configuration runs the tests on multiple browsers, including mobile safari, and webkit. What I found was that the current sign in functionality was not working on safari. I checked the video of the failed test run and saw that the sign in button was clicked but no redirect happened.&lt;/p&gt;

&lt;p&gt;While the current sign in functionality is supposed to be for testing and simply logs you in as a user (without any username or password), this could potentially cause problems in the future. So, I filed an &lt;a href="https://github.com/DevelopingSpace/starchart/issues/244"&gt;issue to investigate this&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Starchart: Remix routes setup</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Sun, 12 Feb 2023 09:46:59 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-remix-routes-setup-1jik</link>
      <guid>https://forem.com/eakam/starchart-remix-routes-setup-1jik</guid>
      <description>&lt;p&gt;The past week, I worked on &lt;a href="https://github.com/Seneca-CDOT/starchart/issues/138"&gt;setting up basic user dashboard pages and routes for starchart&lt;/a&gt;. These routes involved pages for management, creation, and help for domains and certificates. The ideas was to setup a basic template, such as a heading, and the routes so these could be easily updated once the designs were finished.&lt;/p&gt;

&lt;p&gt;Since starchart uses &lt;a href="https://remix.run/"&gt;Remix&lt;/a&gt;, this was a straightforward process. Routing in remix can be configured by the file structure for the routes(&lt;a href="https://remix.run/docs/en/v1/guides/routing"&gt;more info here&lt;/a&gt;). So, I setup an initial folder structure for the difference pages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/routes/
  -- certificates/
    -- index.tsx
    -- instructions.tsx
    -- new.tsx
  -- domains/
     -- $domainId.tsx
     -- index.tsx
     -- new.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This defined the following routes (in same order as above):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/certificates&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/certificates/instructions&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/certificates/new&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/domains/:domainId&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/domains&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/domains/new&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After creating a &lt;a href="https://github.com/Seneca-CDOT/starchart/pull/156"&gt;PR&lt;/a&gt;, I got a suggestion to add another component for the header that shows on these pages. So, I thought how I could show the header on all pages without including it everywhere. Initially, I created parent routes for the &lt;code&gt;certificates&lt;/code&gt; and &lt;code&gt;domains&lt;/code&gt; routes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/routes/
  ...
  -- certificates.tsx
  -- domains.tsx
  ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These only served to include the header, and then rendered the children using the &lt;code&gt;&amp;lt;Outlet /&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Outlet&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@remix-run/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Header&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;~/components/header&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;DomainsRoute&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="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Header&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Outlet&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/main&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;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;p&gt;I got another suggestion to move it up another level so I would not have to include the header in two parent route files. I thought about moving it to the root file. However, this would mean that the header would also render on the login page, or more logic would need to be added to hide the header if the user was not logged in. I tried looking for a way to do this purely through the file structure, and found &lt;a href="https://dev.to/pckilgore/remix-sharing-your-index-layout-with-sub-routes-2856"&gt;this helpful blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To summarize, I added a pathless layout route for the index page, and placed my routes inside the &lt;code&gt;__index&lt;/code&gt; directory. Thus, my routes would be children of the &lt;code&gt;__index&lt;/code&gt; route (which does not have a URL and is simply the layout for these routes). The index page itself is also inside this directory. And since the login page is still separate, it is unaffected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/routes/
  -- __index.tsx
  -- login.tsx
  ...
  -- __index/
    -- certificate/
      -- index.tsx
      ...
    -- domains/
      -- index.tsx
      ...
    -- index.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;__index.tsx&lt;/code&gt; is the same as the previous parent layout routes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Box&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@chakra-ui/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Outlet&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@remix-run/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Header&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;~/components/header&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Index&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="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Box&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Header&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Outlet&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/main&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Box&lt;/span&gt;&lt;span class="err"&gt;&amp;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;



</description>
    </item>
    <item>
      <title>Starchart: Playwright and Chakra UI Setup</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Sat, 04 Feb 2023 04:38:53 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-playwright-and-chakra-ui-1ib</link>
      <guid>https://forem.com/eakam/starchart-playwright-and-chakra-ui-1ib</guid>
      <description>&lt;p&gt;The past week I worked on setting up &lt;a href="https://playwright.dev/" rel="noopener noreferrer"&gt;Playwright&lt;/a&gt;, and &lt;a href="https://chakra-ui.com/" rel="noopener noreferrer"&gt;Chakra UI&lt;/a&gt; with &lt;a href="https://github.com/Seneca-CDOT/starchart" rel="noopener noreferrer"&gt;starchart&lt;/a&gt;. Chakra UI is needed so that their components could be used to build the web pages, and Playwright is to be used for end-to-end testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chakra UI Setup
&lt;/h3&gt;

&lt;p&gt;Setting up Chakra UI was relatively simple. I followed their &lt;a href="https://chakra-ui.com/getting-started/remix-guide" rel="noopener noreferrer"&gt;instructions&lt;/a&gt; for the most part. I also found &lt;a href="https://github.com/remix-run/examples/tree/main/chakra-ui" rel="noopener noreferrer"&gt;this example&lt;/a&gt; to be really helpful. My process for this went like this: I looked at the instructions in Chakra UI docs for the client, server and root files, and compared them with the existing code in starchart. Then, I also referenced them against the example code. &lt;/p&gt;

&lt;p&gt;Not an ideal process to follow, but since I do not understand Chakra UI or Remix that well yet, I felt that this was the best way to do the setup. It worked, and I created a &lt;a href="https://github.com/Seneca-CDOT/starchart/pull/75" rel="noopener noreferrer"&gt;PR&lt;/a&gt;. Based on some feedback, I added some basic components (instead of using html tags) to the index page so some manual testing could be done. &lt;/p&gt;

&lt;p&gt;Now, if you followed the PR link, you would have seen that it was merged but had a failing check. And that is what was addressed later while adding Playwright. Since the project was setup using the &lt;a href="https://github.com/remix-run/blues-stack" rel="noopener noreferrer"&gt;Remix blues stack&lt;/a&gt;, it shipped with &lt;a href="https://www.cypress.io/" rel="noopener noreferrer"&gt;cypress&lt;/a&gt; for end-to-end testing. The cypress folder had some tests but these were not modified when the app was setup since we intended to use Playwright. This resulted in the typecheck job failing, since it was also checking the cypress folder: &lt;code&gt;tsc &amp;amp;&amp;amp; tsc cypress&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Playwright Setup
&lt;/h3&gt;

&lt;p&gt;Setting up Playwright took longer than I had expected. First, I made a list of node modules that needed to be removed. These included &lt;code&gt;cypress&lt;/code&gt;, &lt;code&gt;@faker-js/faker&lt;/code&gt;, &lt;code&gt;@testing-library/cypress&lt;/code&gt;, and &lt;code&gt;eslint-plugin-cypress&lt;/code&gt;. These were only used by cypress so I uninstalled them using &lt;code&gt;npm uninstall&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, I deleted the cypress folder, and the configuration file for cypress (&lt;code&gt;cypress.config.ts&lt;/code&gt;). I installed playwright by using &lt;code&gt;npm init playwright@latest&lt;/code&gt;, and following the prompts (&lt;a href="https://playwright.dev/docs/intro" rel="noopener noreferrer"&gt;docs&lt;/a&gt;). This also generated a config file for playwright, some simple tests in the specified test folder, and some more detailed examples of tests. I deleted the folder containing the examples since it was simply for reference, and added some basic tests.&lt;/p&gt;

&lt;p&gt;For the configuration, I ended up using the defaults for most of the options. I also uncommented the configuration for mobile viewpoints, branded browsers, and output directory for test artifacts; and added the following based on some feedback:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`http://localhost:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;on-first-retry&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Setting a &lt;code&gt;baseURl&lt;/code&gt; allows navigating to a page with a relative URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second configuration &lt;a href="https://playwright.dev/docs/videos" rel="noopener noreferrer"&gt;records a video&lt;/a&gt; of the test on the first retry after it fails.&lt;/p&gt;

&lt;h4&gt;
  
  
  Trying to Setup CI
&lt;/h4&gt;

&lt;p&gt;So far, this process was pretty simple. Installing playwright also auto generates a GitHub workflow file. I tried adding a new job based on this auto generated file, and updated some npm scripts that were previously being used for cypress to run the tests. However, to run the tests, the app must be started. And to do that, the mysql database container must be running. I tried using the defined docker script, which uses &lt;code&gt;docker-compose up -d&lt;/code&gt; to start the container but &lt;code&gt;prisma db push&lt;/code&gt; failed with the following error:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F78xf12vb9z6md64kuakq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F78xf12vb9z6md64kuakq.png" alt="Error Server has closed the connection" width="481" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I tried a bunch of things to try and fix this. I posted about this in Slack, and found out that mysql can take a while to start. So, I tried adding a wait before running the tests based on &lt;a href="https://github.com/docker-library/mysql/issues/547#issuecomment-1002685663" rel="noopener noreferrer"&gt;this discussion&lt;/a&gt;. However, this still resulted in the same error. I even tried doing &lt;code&gt;prisma db pull&lt;/code&gt; before &lt;code&gt;prisma db push&lt;/code&gt;. However, I got a different error this time:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fktsss4boomn5at8z2xqz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fktsss4boomn5at8z2xqz.png" alt="Error THe introspected database was empty" width="800" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was really strange, since the database should have been setup. Still I did not know why this was failing. &lt;/p&gt;

&lt;h4&gt;
  
  
  Using Service Containers
&lt;/h4&gt;

&lt;p&gt;Since I was basically out of ideas on how to fix this, I tried completely reworking the job by using a &lt;a href="https://docs.github.com/en/actions/using-containerized-services/about-service-containers" rel="noopener noreferrer"&gt;service container&lt;/a&gt; for mysql instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;E2E-Test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;timeout-minutes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;mysql&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mysql:8&lt;/span&gt;
        &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;3306:3306&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;MYSQL_DATABASE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;starchart&lt;/span&gt;
          &lt;span class="na"&gt;MYSQL_USER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;starchart&lt;/span&gt;
          &lt;span class="na"&gt;MYSQL_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;starchart_password&lt;/span&gt;
          &lt;span class="na"&gt;MYSQL_ROOT_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root_password&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="s"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the tests worked! I am still not sure why they were failing before. Maybe docker-compose doesn't work with GitHub actions? &lt;br&gt;
With this, I marked the &lt;a href="https://github.com/Seneca-CDOT/starchart/pull/85" rel="noopener noreferrer"&gt;PR&lt;/a&gt; ready for review, and the broken CI was fixed.&lt;/p&gt;

</description>
      <category>announcement</category>
      <category>web3</category>
      <category>crypto</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Starchart: release 0.1 planning</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Sat, 28 Jan 2023 04:58:08 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-release-01-planning-55ob</link>
      <guid>https://forem.com/eakam/starchart-release-01-planning-55ob</guid>
      <description>&lt;p&gt;This week, after some discussion, a plan was made for release 0.1 of &lt;a href="https://github.com/Seneca-CDOT/starchart"&gt;starchart&lt;/a&gt;. This involved getting an initial app setup using Remix's &lt;a href="https://github.com/remix-run/blues-stack"&gt;blues stack&lt;/a&gt; so that people could code on top of it. Next step involved creating some issues which could be addressed in release 0.1 release 0.2 and some for further releases. As I am mostly focused on front-end and testing, I created the following issues: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Seneca-CDOT/starchart/issues/24"&gt;Setup Chakra UI for Remix&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Seneca-CDOT/starchart/issues/26"&gt;Add jest for unit testing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Seneca-CDOT/starchart/issues/25"&gt;Add playwright for end-to-end testing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Seneca-CDOT/starchart/issues/45"&gt;Add a healthcheck route for the server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Seneca-CDOT/starchart/issues/46"&gt;Add a user domain management page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Seneca-CDOT/starchart/issues/48"&gt;Add a domain creation page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Seneca-CDOT/starchart/issues/23"&gt;Add an Admin Dashboard page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first three issues are the ones that I plan to address in the next few days for release 0.1, which would be next Friday. These could be done in any order but I think setting up Chakra UI with Remix should come first since this would allow the use of Chakra UI components for building the pages. &lt;/p&gt;

&lt;p&gt;This could be followed by adding jest and playwright for testing. Part of this also involves removing any unneeded dependencies that the Remix blues stack comes with, such as &lt;a href="https://www.cypress.io/"&gt;Cypress&lt;/a&gt;, which is another end-to-end testing framework.&lt;br&gt;
Adding a healthcheck route could also be done in release 0.1 or release 0.2. This would be a &lt;code&gt;/healthcheck&lt;/code&gt; route that returns a 200 response with a message stating that the server is running. &lt;/p&gt;

&lt;p&gt;The other issues would take longer to address. The user domain management page is supposed to be a page which allows users to view and manage their existing domains. This page also links to the domain creation page, which has a form to allow creation of new domains.&lt;/p&gt;

&lt;p&gt;The admin dashboard would serve as a place for admins to view all the certificates, domains, and users. This also includes the ability to search and filter through this data, and update any records. Some aspects of the user dashboard could be reused for this page as well.&lt;/p&gt;

&lt;p&gt;Adding these pages requires a design to be created first. One such issue is being worked on to create designs for user dashboard pages using figma (&lt;a href="https://github.com/Seneca-CDOT/starchart/issues/36"&gt;#36 Create user dashboard pages design&lt;/a&gt;).&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Starchart: Picking a project area</title>
      <dc:creator>Eakam</dc:creator>
      <pubDate>Sat, 21 Jan 2023 05:02:10 +0000</pubDate>
      <link>https://forem.com/eakam/starchart-picking-a-project-area-2hn</link>
      <guid>https://forem.com/eakam/starchart-picking-a-project-area-2hn</guid>
      <description>&lt;p&gt;As we continue to work on developing &lt;a href="https://github.com/Seneca-CDOT/starchart" rel="noopener noreferrer"&gt;starchart&lt;/a&gt;, which is a project that aims to make it easier to Seneca developers to create SSL certificates (without worrying about the costs or the need to provide personally identifiable information), a list of task groups has been created to make it easier to visualize the different parts of the project. These include Web, Testing, Server, DNS, etc. (full list &lt;a href="https://github.com/Seneca-CDOT/starchart/wiki/Initial-Task-List-and-Scope" rel="noopener noreferrer"&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;I have spent the last week thinking about where I can contribute. An obvious choice was &lt;code&gt;Testing&lt;/code&gt; as I spent the previous week researching &lt;a href="https://playwright.dev/" rel="noopener noreferrer"&gt;Playwright&lt;/a&gt;, which is a framework for end-to-end testing. As I looked into some of its features, I found that it has &lt;a href="https://playwright.dev/docs/actionability" rel="noopener noreferrer"&gt;auto-wait functionality&lt;/a&gt; for its tests by default. Basically, before an action is performed on an element(e.g. click), it will wait for it to be in a specific state (e.g. attached to the DOM) based on the action. This reduces flaky tests which fail if a statement executes before the element is ready.&lt;/p&gt;

&lt;p&gt;Further, through &lt;a href="https://playwright.dev/docs/codegen#running-codegen" rel="noopener noreferrer"&gt;Codegen&lt;/a&gt;, tests can be automatically generated based on actions performed in the browser. This should reduce the time required for writing tests quite a bit. So, in addition to working on testing, I also decided to contribute to the &lt;code&gt;Web&lt;/code&gt; component, which involves building the pages for the app. This will be done using &lt;a href="https://chakra-ui.com/" rel="noopener noreferrer"&gt;Chakra UI&lt;/a&gt; and &lt;a href="https://remix.run/" rel="noopener noreferrer"&gt;Remix&lt;/a&gt;. Chakra UI provides a bunch of components  for different needs such as tooltips, cards, popups, and &lt;a href="https://chakra-ui.com/docs/components" rel="noopener noreferrer"&gt;many more&lt;/a&gt;. I have worked on building webpages a lot in the past five months, and even though I have never used Chakra UI, I think I would still be able to utilize some of that experience here.&lt;/p&gt;

&lt;p&gt;Finally, this is meant as a guideline, and not restrictions, for which parts of the project I would like to contribute to.&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
  </channel>
</rss>
