Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler M. Neher <[email protected]>
  • Loading branch information
tylermneher committed May 6, 2024
1 parent be1a021 commit df1c74c
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 22 deletions.
7 changes: 3 additions & 4 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
content="Cybersecurity professional with a background in data science and software development.">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" type="text/css" href="styles-index-and-404.css">
<link rel="stylesheet" type="text/css" href="styles.css">

<meta property="og:type" content="website" />
<meta name="og:description"
Expand Down Expand Up @@ -80,9 +80,8 @@ <h2>404 Page Not Found</h2>
</div>
<footer id="footer">
<p align="center">© 2024 Tyler M. Neher</p>
<p align="center"><a data-cy="404-footer-contact" href="contact.html">Contact Me</a> | <a rel="pgpkey"
href="tyler.pubkey.asc">PGP
Key</a></p>
<p align="center"><a data-cy="404-footer-contact" href="contact.html">Contact Me</a> | <a
data-cy="404-footer-pgpkey" rel="pgpkey" href="tyler.pubkey.asc">PGP Key</a></p>
</footer>
</div>

Expand Down
11 changes: 5 additions & 6 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ <h2>Contact Me</h2>
</tr>
<tr>
<td>PGP Key</td>
<td><a rel="pgpkey" href="tyler.pubkey.asc">PGP Key</a> also on <a
data-cy="contact-body-table-keybasepgp" rel="keybase"
<td><a data-cy="contact-body-table-pgpkey" rel="pgpkey" href="tyler.pubkey.asc">PGP</a>
also on <a data-cy="contact-body-table-keybasepgpkey" rel="keybase"
href="https://keybase.io/tylermneher/pgp_keys.asc">Keybase</a></td>
</tr>
<tr>
Expand All @@ -118,7 +118,7 @@ <h2>Contact Me</h2>
<tr>
<td>Linkedin</td>
<td><a data-cy="contact-body-table-linkedin"
href="https://www.linkedin.com/in/tylermneher/">@tylermneher</a></td>
href="https://www.linkedin.com/in/tylermneher">@tylermneher</a></td>
</tr>
<tr>
<td>Keybase</td>
Expand Down Expand Up @@ -163,9 +163,8 @@ <h2>Contact Me</h2>
</div>
<footer id="footer">
<p align="center">© 2024 Tyler M. Neher</p>
<p align="center"><a data-cy="contact-footer-contact" href="contact.html">Contact Me</a> | <a rel="pgpkey"
href="tyler.pubkey.asc">PGP
Key</a></p>
<p align="center"><a data-cy="contact-footer-contact" href="contact.html">Contact Me</a> | <a
data-cy="contact-footer-pgpkey" rel="pgpkey" href="tyler.pubkey.asc">PGP Key</a></p>
</footer>
</div>

Expand Down
28 changes: 25 additions & 3 deletions cypress/e2e/404.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
describe("404.html spec", () => {
it("passes", () => {
cy.visit("https://example.cypress.io");
describe("404", function () {
beforeEach(function () {
cy.visit("/404.html");
});
it("Visits the 404 Page", () => {
context("Testing the Body Portfolio link", function () {
cy.get('[data-cy="404-body-portfolio"]').should("be.visible");
cy.get('[data-cy="404-body-portfolio"]').should("have.attr", "href", "portfolio.html");
cy.get('[data-cy="404-body-portfolio"]').should("have.text", "Portfolio");
});
context("Testing the Body Contact link", function () {
cy.get('[data-cy="404-body-contact"]').should("be.visible");
cy.get('[data-cy="404-body-contact"]').should("have.attr", "href", "contact.html");
cy.get('[data-cy="404-body-contact"]').should("have.text", "Contact");
});
context("Testing the Footer Contact link", function () {
cy.get('[data-cy="404-footer-contact"]').should("be.visible");
cy.get('[data-cy="404-footer-contact"]').should("have.attr", "href", "contact.html");
cy.get('[data-cy="404-footer-contact"]').should("have.text", "Contact Me");
});
context("Testing the Footer PGP link", function () {
cy.get('[data-cy="404-footer-pgpkey"]').should("be.visible");
cy.get('[data-cy="404-footer-pgpkey"]').should("have.attr", "href", "tyler.pubkey.asc");
cy.get('[data-cy="404-footer-pgpkey"]').should("have.text", "PGP Key");
});
});
});
71 changes: 68 additions & 3 deletions cypress/e2e/contact.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
describe("contact.html spec", () => {
it("passes", () => {
cy.visit("https://example.cypress.io");
describe("Contact", function () {
beforeEach(function () {
cy.visit("/contact.html");
});
it("Visits the Contact Page", () => {
// Body Links Tests
context("Testing the Body Portfolio link", function () {
cy.get('[data-cy="contact-body-portfolio"]').should("be.visible");
cy.get('[data-cy="contact-body-portfolio"]').should("have.attr", "href", "portfolio.html");
cy.get('[data-cy="contact-body-portfolio"]').should("have.text", "Portfolio");
});
context("Testing the Body Home link", function () {
cy.get('[data-cy="contact-body-index"]').should("be.visible");
cy.get('[data-cy="contact-body-index"]').should("have.attr", "href", "index.html");
cy.get('[data-cy="contact-body-index"]').should("have.text", "Home");
});

// Table Links Tests
context("Testing the Body Table PGP links", function () {
cy.get('[data-cy="contact-body-table-pgpkey"]').should("be.visible");
cy.get('[data-cy="contact-body-table-pgpkey"]').should("have.attr", "href", "tyler.pubkey.asc");
cy.get('[data-cy="contact-body-table-pgpkey"]').should("have.text", "PGP");
cy.get('[data-cy="contact-body-table-keybasepgpkey"]').should("be.visible");
cy.get('[data-cy="contact-body-table-keybasepgpkey"]').should("have.attr", "href", "https://keybase.io/tylermneher/pgp_keys.asc");
cy.get('[data-cy="contact-body-table-keybasepgpkey"]').should("have.text", "Keybase");
});
context("Testing the Body Table Resume link", function () {
cy.get('[data-cy="contact-body-table-resume"]').should("be.visible");
cy.get('[data-cy="contact-body-table-resume"]').should("have.attr", "href", "https://resume.tylermneher.me");
cy.get('[data-cy="contact-body-table-resume"]').should("have.text", "Resume");
});
context("Testing the Body Table GitHub link", function () {
cy.get('[data-cy="contact-body-table-github"]').should("be.visible");
cy.get('[data-cy="contact-body-table-github"]').should("have.attr", "href", "https://www.github.com/tylermneher");
cy.get('[data-cy="contact-body-table-github"]').should("have.text", "@tylermneher");
});
context("Testing the Body Table GitLab link", function () {
cy.get('[data-cy="contact-body-table-gitlab"]').should("be.visible");
cy.get('[data-cy="contact-body-table-gitlab"]').should("have.attr", "href", "https://www.gitlab.com/tylermneher");
cy.get('[data-cy="contact-body-table-gitlab"]').should("have.text", "@tylermneher");
});
context("Testing the Body Table LinkedIn link", function () {
cy.get('[data-cy="contact-body-table-linkedin"]').should("be.visible");
cy.get('[data-cy="contact-body-table-linkedin"]').should("have.attr", "href", "https://www.linkedin.com/in/tylermneher");
cy.get('[data-cy="contact-body-table-linkedin"]').should("have.text", "@tylermneher");
});
context("Testing the Body Table Keybase links", function () {
cy.get('[data-cy="contact-body-table-keybase"]').should("be.visible");
cy.get('[data-cy="contact-body-table-keybase"]').should("have.attr", "href", "https://keybase.io/tylermneher");
cy.get('[data-cy="contact-body-table-keybase"]').should("have.text", "@tylermneher");
});
context("Testing the Body Table Instagram link", function () {
cy.get('[data-cy="contact-body-table-instagram"]').should("be.visible");
cy.get('[data-cy="contact-body-table-instagram"]').should("have.attr", "href", "https://www.instagram.com/tylermneher");
cy.get('[data-cy="contact-body-table-instagram"]').should("have.text", "@tylermneher");
});

// Footer Links Tests
context("Testing the Footer Contact link", function () {
cy.get('[data-cy="contact-footer-contact"]').should("be.visible");
cy.get('[data-cy="contact-footer-contact"]').should("have.attr", "href", "contact.html");
cy.get('[data-cy="contact-footer-contact"]').should("have.text", "Contact Me");
});
context("Testing the Footer PGP link", function () {
cy.get('[data-cy="contact-footer-pgpkey"]').should("be.visible");
cy.get('[data-cy="contact-footer-pgpkey"]').should("have.attr", "href", "tyler.pubkey.asc");
cy.get('[data-cy="contact-footer-pgpkey"]').should("have.text", "PGP Key");
});
});
});
33 changes: 30 additions & 3 deletions cypress/e2e/index.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
describe("index.html spec", () => {
it("passes", () => {
cy.visit("https://example.cypress.io");
describe("Homepage", function () {
beforeEach(function () {
cy.visit("/index.html");
});
it("Visits the Homepage", () => {
context("Testing the Body Resume link", function () {
cy.get('[data-cy="index-body-resume"]').should("be.visible");
cy.get('[data-cy="index-body-resume"]').should("have.attr", "href", "https://resume.tylermneher.me");
cy.get('[data-cy="index-body-resume"]').should("have.text", "Resume");
});
context("Testing the Body Portfolio link", function () {
cy.get('[data-cy="index-body-portfolio"]').should("be.visible");
cy.get('[data-cy="index-body-portfolio"]').should("have.attr", "href", "portfolio.html");
cy.get('[data-cy="index-body-portfolio"]').should("have.text", "Portfolio");
});
context("Testing the Body Contact link", function () {
cy.get('[data-cy="index-body-contact"]').should("be.visible");
cy.get('[data-cy="index-body-contact"]').should("have.attr", "href", "contact.html");
cy.get('[data-cy="index-body-contact"]').should("have.text", "Contact");
});
context("Testing the Footer Contact link", function () {
cy.get('[data-cy="index-footer-contact"]').should("be.visible");
cy.get('[data-cy="index-footer-contact"]').should("have.attr", "href", "contact.html");
cy.get('[data-cy="index-footer-contact"]').should("have.text", "Contact Me");
});
context("Testing the Footer PGP link", function () {
cy.get('[data-cy="index-footer-pgpkey"]').should("be.visible");
cy.get('[data-cy="index-footer-pgpkey"]').should("have.attr", "href", "tyler.pubkey.asc");
cy.get('[data-cy="index-footer-pgpkey"]').should("have.text", "PGP Key");
});
});
});
5 changes: 2 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ <h3><a data-cy="index-body-resume" href="https://resume.tylermneher.me">Resume</
</div>
<footer id="footer">
<p align="center">© 2024 Tyler M. Neher</p>
<p align="center"><a data-cy="index-footer-contact" href="contact.html">Contact Me</a> | <a rel="pgpkey"
href="tyler.pubkey.asc">PGP
Key</a></p>
<p align="center"><a data-cy="index-footer-contact" href="contact.html">Contact Me</a> | <a
data-cy="index-footer-pgpkey" rel="pgpkey" href="tyler.pubkey.asc">PGP Key</a></p>
</footer>
</div>

Expand Down

0 comments on commit df1c74c

Please sign in to comment.