Skip to content

Commit

Permalink
test: playwright update, test id's, tc and other fixes (#62)
Browse files Browse the repository at this point in the history
* remove: hamburger menu and not correctlinks

* test: remove hamburger tests

* test: more fixes

* test: update playwright, change urls

* footer tests fix

* test: test-d, tc and other fixes

* test:added more tests

* test: added footer id and tests

* fix: deleted doubled url, changed pp, contact url

* chore(package-lock.json): update package lock

Co-authored-by: Sebastian <[email protected]>
Co-authored-by: alepar <[email protected]>
  • Loading branch information
3 people authored Mar 10, 2022
1 parent 25a2d27 commit 642e331
Show file tree
Hide file tree
Showing 14 changed files with 15,174 additions and 1,785 deletions.
16,398 changes: 14,923 additions & 1,475 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"devDependencies": {
"@commitlint/cli": "^12.0.0",
"@commitlint/config-conventional": "^12.0.0",
"@playwright/test": "^1.15.2",
"@playwright/test": "^1.19.2",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
Expand Down
64 changes: 52 additions & 12 deletions tests/footer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,79 @@ test.describe('Footer tests', () => {
await page.goto('/');
});

test('Should assert visibility and url of development', async () => {
await po.footer.developmentUrl();
test('Should assert visibility and url of whitepaper', async () => {
await po.footer.whitepaperUrl();
});

test('Should assert visibility and url of features', async () => {
await po.footer.featuresUrl();
});

test('Should assert visibility and url of ecosystem', async () => {
await po.footer.ecosystemUrl();
test('Should assert visibility and url of blog', async () => {
await po.footer.blogUrl();
});

test('Should assert visibility and url of tutorials', async () => {
await po.footer.tutorialsUrl();
});

test('Should assert visibility and url of education', async () => {
await po.footer.educationUrl();
test('Should assert visibility and url of wrapped BTCV', async () => {
await po.footer.wrappedUrl();
});

test('Should assert visibility and url of how to use BTCV', async () => {
await po.footer.howToUseBTCVUrl();
});

test('Should assert visibility and url of community', async () => {
await po.footer.communityUrl();
});

test('Should assert visibility and url of team', async () => {
await po.footer.teamUrl();
});

test('Should assert visibility and url of faq', async () => {
await po.footer.faqUrl();
});

test('Should assert visibility and url of newsletter', async () => {
await po.footer.newsletterUrl();
});

test('Should assert visibility and url of contact', async () => {
await po.footer.contactUrl();
});

test('Should assert visibility and url of whitepaper', async () => {
await po.footer.whitepaperUrl();
test('Should assert twitter footer url & visibility', async () => {
await po.footer.twitterFooterUrl();
});

test('Should assert visibility and url of roadmap', async () => {
await po.footer.roadmapUrl();
test('Should assert telegram footer url & visibility', async () => {
await po.footer.telegramFooterUrl();
});

test('Should assert visibility and url of faq', async () => {
await po.footer.faqUrl();
test('Should assert medium footer url & visibility', async () => {
await po.footer.mediumFooterUrl();
});

test('Should assert facebook footer url & visibility', async () => {
await po.footer.facebookFooterUrl();
});

test('Should assert youtube footer url & visibility', async () => {
await po.footer.youtubeFooterUrl();
});

test('Should assert instagram footer url & visibility', async () => {
await po.footer.instagramFooterUrl();
});

test('Should assert github footer url & visibility', async () => {
await po.footer.githubFooterUrl();
});

test('Should assert btcv footer url & visibility', async () => {
await po.footer.btcvFooterUrl();
});
});
63 changes: 0 additions & 63 deletions tests/hamburgerMenu.spec.ts

This file was deleted.

37 changes: 32 additions & 5 deletions tests/header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test.describe('Header tests', () => {
});

test('should open bitcoinvault global after clicking a logo', async () => {
test.fixme()
await po.header.bitcoinvaultLogoRedirect();
});

Expand Down Expand Up @@ -46,11 +45,39 @@ test.describe('Header tests', () => {
await po.header.hashrateDistributionUrl();
});

test('Should assert Richest Wallets url & visibility', async () => {
await po.header.richestWalletsUrl();
});

test('Should assert Coin distribution url & visibility', async () => {
await po.header.coinDistributionUrl();
});

test('Should assert twitter header url & visibility', async () => {
await po.header.twitterHeaderUrl();
});

test('Should assert telegram header url & visibility', async () => {
await po.header.telegramHeaderUrl();
});

test('Should assert medium header url & visibility', async () => {
await po.header.mediumHeaderUrl();
});

test('Should assert facebook header url & visibility', async () => {
await po.header.facebookHeaderUrl();
});

test('Should assert youtube header url & visibility', async () => {
await po.header.youtubeHeaderUrl();
});

test('Should assert instagram header url & visibility', async () => {
await po.header.instagramHeaderUrl();
});

test('Should assert github header url & visibility', async () => {
await po.header.githubHeaderUrl();
});

test('Should assert btcv header url & visibility', async () => {
await po.header.btcvHeaderUrl();
});
});
129 changes: 96 additions & 33 deletions tests/helpers/pageObjects/footer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,132 @@ import { expect } from '@playwright/test';
import type { Page } from '@playwright/test';

export class Footer {
private development = this.page.locator('[data-test-id="development"]');
private whitepaper = this.page.locator('[data-test-id="whitepaper"]');
private features = this.page.locator('[data-test-id="features"]');
private ecosystem = this.page.locator('[data-test-id="ecosystem"]');
private education = this.page.locator('[data-test-id="education"]');
private blog = this.page.locator('[data-test-id="blog"]');
private tutorials = this.page.locator('[data-test-id="tutorials"]');
private wrapped = this.page.locator('[data-test-id="wrapped"]');
private howToUseBTCV = this.page.locator('[data-test-id="howToUseBTCV"]');
private community = this.page.locator('[data-test-id="community"]');
private contact = this.page.locator('[data-test-id="contact"]');
private whitepaper = this.page.locator('[data-test-id="whitepaper"]');
private roadmap = this.page.locator('[data-test-id="roadmap"]');
private team = this.page.locator('[data-test-id="team"]');
private faq = this.page.locator('[data-test-id="faq"]');
private newsletter = this.page.locator('[data-test-id="newsletter"]');
private contact = this.page.locator('[data-test-id="contact"]');
private twitterFooter = this.page.locator('[data-test-id="twitterFooter"]')
private telegramFooter = this.page.locator('[data-test-id="telegramFooter"]')
private mediumFooter = this.page.locator('[data-test-id="mediumFooter"]')
private facebookFooter = this.page.locator('[data-test-id="facebookFooter"]')
private instagramFooter = this.page.locator('[data-test-id="instagramFooter"]')
private youtubeFooter = this.page.locator('[data-test-id="youtubeFooter"]')
private githubFooter = this.page.locator('[data-test-id="githubFooter"]')
private btcvFooter = this.page.locator('[data-test-id="btcvFooter"]')


constructor(private page: Page) {}

async developmentUrl() {
await this.development.isVisible();
await this.development.click();
await expect(this.page.url()).toMatch('https://bitcoinvault.global/btcv-explained');
async whitepaperUrl() {
await this.whitepaper.isVisible();
await this.whitepaper.click();
await expect(this.page.url()).toMatch('https://btcv.com/whitepaper');
}

async featuresUrl() {
await this.features.isVisible();
await this.features.click();
await expect(this.page.url()).toMatch('https://bitcoinvault.global/features');
await expect(this.page.url()).toMatch('https://btcv.com/features');
}

async blogUrl() {
await this.blog.isVisible();
await this.blog.click();
await expect(this.page.url()).toMatch('https://btcv.com/blog');
}

async ecosystemUrl() {
await this.ecosystem.isVisible();
await this.ecosystem.click();
await expect(this.page.url()).toMatch('https://bitcoinvault.global/ecosystem');
async tutorialsUrl() {
await this.tutorials.isVisible();
await this.tutorials.click();
await expect(this.page.url()).toMatch('https://btcv.com/tutorials');
}

async educationUrl() {
await this.education.isVisible();
await this.education.click();
await expect(this.page.url()).toMatch('https://bitcoinvault.global/tutorials');
async wrappedUrl() {
await this.wrapped.isVisible();
await this.wrapped.click();
await expect(this.page.url()).toMatch('https://btcv.com/wrapped');
}

async howToUseBTCVUrl() {
await this.howToUseBTCV.isVisible();
await this.howToUseBTCV.click();
await expect(this.page.url()).toMatch('https://btcv.com/how-to-use-btcv');
}

async communityUrl() {
await this.community.isVisible();
await this.community.click();
await expect(this.page.url()).toMatch('https://bitcoinvault.global/community');
await expect(this.page.url()).toMatch('https://btcv.com/community');
}

async teamUrl() {
await this.team.isVisible();
await this.team.click();
await expect(this.page.url()).toMatch('https://btcv.com/our-team');
}

async faqUrl() {
await this.faq.isVisible();
await this.faq.click();
await expect(this.page.url()).toMatch('https://btcv.com/faq');
}

async newsletterUrl() {
await this.newsletter.isVisible();
await this.newsletter.click();
await expect(this.page.url()).toMatch('https://btcv.com/newsletter');
}

async contactUrl() {
await this.contact.isVisible();
await this.contact.click();
await expect(this.page.url()).toMatch('https://bitcoinvault.global/contact');
await expect(this.page.url()).toMatch('https://btcv.com/contact');
}

async whitepaperUrl() {
await this.whitepaper.isVisible();
await this.whitepaper.click();
await expect(this.page.url()).toMatch('https://bitcoinvault.global/whitepaper');
async twitterFooterUrl() {
await this.twitterFooter.isVisible();
await expect((this.twitterFooter).first()).toHaveAttribute('href', 'https://twitter.com/vaultbitcoin');
}

async roadmapUrl() {
await this.roadmap.isVisible();
await this.roadmap.click();
await expect(this.page.url()).toMatch('https://bitcoinvault.global/roadmap');
async telegramFooterUrl() {
await this.telegramFooter.isVisible;
await expect((this.telegramFooter).first()).toHaveAttribute('href', 'https://t.me/Bitcoin_Vault');
}

async faqUrl() {
await this.faq.isVisible();
await this.faq.click();
await expect(this.page.url()).toMatch('https://bitcoinvault.global/faq');
async mediumFooterUrl() {
await this.mediumFooter.isVisible;
await expect((this.mediumFooter).first()).toHaveAttribute('href', 'https://medium.com/bitcoin-vault-btcv');
}

async facebookFooterUrl() {
await this.facebookFooter.isVisible;
await expect((this.facebookFooter).first()).toHaveAttribute('href', 'https://www.facebook.com/bitcoinvaultofficial');
}

async instagramFooterUrl() {
await this.instagramFooter.isVisible;
await expect((this.instagramFooter).first()).toHaveAttribute('href', 'https://www.instagram.com/bitcoinvaultofficial');
}

async youtubeFooterUrl() {
await this.youtubeFooter.isVisible;
await expect((this.youtubeFooter).first()).toHaveAttribute('href', 'https://www.youtube.com/c/BitcoinVault');
}

async githubFooterUrl() {
await this.githubFooter.isVisible;
await expect((this.githubFooter).first()).toHaveAttribute('href', 'https://github.com/bitcoinvault');
}

async btcvFooterUrl() {
await this.btcvFooter.isVisible;
await expect((this.btcvFooter).first()).toHaveAttribute('href', 'https://btcv.com/');
}
}
Loading

0 comments on commit 642e331

Please sign in to comment.