Skip to content

Commit

Permalink
🔧 cypressのテストを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
ayasamind committed Mar 5, 2021
1 parent 627ae62 commit 11090c3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
- name: Install Dependecires
run: |
yarn install
- name: Run tests
- name: Run Linter Test
run: |
npx htmlhint "src/*.html"
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"baseUrl": "http://localhost:3000/",
"baseUrl": "http://localhost:3000/"
}
23 changes: 23 additions & 0 deletions cypress/integration/station1.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('todo list e2e', function () {
beforeEach(() => { // functionの前に必ず実行される
// baseUrlのrootへ
cy.visit('/station1.html');
});
it('has HTML Tags', function () {
cy.get('html')
.should('be.visible')
});
it('Image Should have Alt', function () {
cy.get('img')
.should('have.attr', 'alt')

cy.get('img')
.should('have.src', 'alt')
});
it('Title Should Be P Tag', function () {
cy.get('p')
.should(($p) => {
expect($p.first()).to.contain('タイトル')
})
});
});

0 comments on commit 11090c3

Please sign in to comment.