Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #360 from true-runes/development
Browse files Browse the repository at this point in the history
v14.0.0
  • Loading branch information
nikukyugamer authored Jun 5, 2022
2 parents 5ccc9a8 + 7cbb166 commit 099f086
Show file tree
Hide file tree
Showing 20 changed files with 969 additions and 916 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ on:
branches:
- main
- development
pull_request:
branches:
- main
- development

jobs:
cypress_gss2022_frontend:
name: Cypress での E2E テスト
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- name: Checkout
uses: actions/[email protected]
- name: 環境を確認する
run: |
echo '[$ pwd]'
Expand All @@ -29,7 +34,7 @@ jobs:
sudo ln -s /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0 /usr/lib/x86_64-linux-gnu/libffi.so.6
- name: Node.js をインストールする
run: |
curl -sSL "https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xz" | tar --strip-components=2 -xJ -C /usr/local/bin/ node-v16.14.2-linux-x64/bin/node
curl -sSL "https://nodejs.org/dist/v18.2.0/node-v18.2.0-linux-x64.tar.xz" | tar --strip-components=2 -xJ -C /usr/local/bin/ node-v18.2.0-linux-x64/bin/node
curl https://www.npmjs.com/install.sh | bash
echo 'インストールされた Node.js のバージョンは、'
node -v
Expand Down Expand Up @@ -59,7 +64,7 @@ jobs:
id: yarn-cache
run: echo "::set-output name=dir::.yarn/cache"
- name: Yarn のキャッシュファイルを取得する
uses: actions/[email protected].2
uses: actions/[email protected].3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
Expand All @@ -68,16 +73,24 @@ jobs:
- name: Npm のパッケージをインストールする ($ yarn install)
run: |
yarn install
- name: Cypress Info を実行する
run: |
npx cypress info
- name: Cypress を実行する
uses: cypress-io/github-action@v3.1.0
uses: cypress-io/github-action@v4.0.0
with:
start: npx cypress
build: npx next build
start: npx next start --port 3100
wait-on: 'http://localhost:3100'
wait-on-timeout: 30 # seconds
working-directory: ./
config-file: cypress.json
config-file: cypress.config.ts
record: false
browser: chrome
# browser: firefox
# browser: edge
env:
DEPLOYMENT_ENVIRONMENT: production
- name: Cypress のスクリーンショットをアップロードする
uses: actions/[email protected]
if: always()
Expand Down
22 changes: 12 additions & 10 deletions components/HumbergerMenu/HumbergerNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ const Navigation = () => {
</li>
<li className="py-2">
<div className="text-base">
{/* <Link href="/events-in-event/oshi-serif" passHref> */}
{/* <span className="link link-hover underline-offset-4"> */}
{locale === 'ja'
? '推し台詞教えて!(準備中)'
: 'Fave quote (in progress)'}
{/* </span> */}
{/* </Link> */}
<Link href="/events-in-event/oshi-serif" passHref>
<span className="link link-hover underline-offset-4">
{locale === 'ja'
? '推し台詞教えて!'
: 'Fave quote'}
</span>
</Link>
</div>
</li>
<li className="py-2">
Expand All @@ -113,9 +113,11 @@ const Navigation = () => {
</li>
<li className="py-2">
<div className="text-base">
{locale === 'ja'
? 'ボーナス票(準備中)'
: 'Bonus votes (in progress)'}
<Link href="/events-in-event/bonus-votes" passHref>
<span className="link link-hover underline-offset-4">
{locale === 'ja' ? 'ボーナス票' : 'Bonus votes'}
</span>
</Link>
</div>
</li>
</ul>
Expand Down
20 changes: 10 additions & 10 deletions components/Kikaku.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ const Kikaku: NextPage = () => {
</Link>
</li>
<li className="pb-4">
{/* <Link href="/events-in-event/oshi-serif" passHref> */}
{/* <span className="link link-hover underline underline-offset-4 text-blue-500 hover:text-blue-900"> */}
{locale === 'ja'
? '推し台詞教えて!(準備中)'
: 'Fave quote (in progress)'}
{/* </span> */}
{/* </Link> */}
<Link href="/events-in-event/oshi-serif" passHref>
<span className="link link-hover underline underline-offset-4 text-blue-500 hover:text-blue-900">
{locale === 'ja' ? '推し台詞教えて!' : 'Fave quote'}
</span>
</Link>
</li>
<li className="pb-4">
<Link href="/events-in-event/op-cl-illustrations" passHref>
Expand All @@ -80,9 +78,11 @@ const Kikaku: NextPage = () => {
</Link>
</li>
<li className="pb-2">
{locale === 'ja'
? 'ボーナス票(準備中)'
: 'Bonus votes (in progress)'}
<Link href="/events-in-event/bonus-votes" passHref>
<span className="link link-hover underline underline-offset-4 text-blue-500 hover:text-blue-900">
{locale === 'ja' ? 'ボーナス票' : 'Bonus votes'}
</span>
</Link>
</li>
</ul>
</div>
Expand Down
24 changes: 24 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineConfig } from 'cypress'

export default defineConfig({
projectId: 'abc987',
downloadsFolder: 'cypress/downloads',
fixturesFolder: 'cypress/fixtures',
screenshotsFolder: 'cypress/screenshots',
videosFolder: 'cypress/videos',
viewportWidth: 1000,
viewportHeight: 660,
retries: {
runMode: 1,
openMode: 0,
},
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:3100',
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
})
16 changes: 0 additions & 16 deletions cypress.json

This file was deleted.

69 changes: 69 additions & 0 deletions cypress/e2e/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
describe('ホームページ', () => {
beforeEach(() => {
// const startSosenkyoDateTime = new Date(
// new Date('2022-06-24 21:00:00').toLocaleString('ja-JP')
// ).getTime()
// cy.clock(startSosenkyoDateTime)

cy.visit('/')
})

it('期待どおりの挙動をすること', () => {
cy.url().should('equal', 'http://localhost:3100/')

cy.get('title').should('have.text', 'ホーム - 幻水総選挙2022')

// h1 タグ
cy.get('h1').should('have.length', 8)
cy.get('h1').each((item, index, list) => {
if (index === 0) {
cy.wrap(item).should('have.text', '幻水総選挙って何?')
}

if (index === 6) {
cy.wrap(item).should('have.text', 'お願い')
}
})
cy.contains('h1', //).should('have.length', 1)

// h2 タグ
cy.get('h2').then((div) => {
cy.wrap(div.eq(0)).should('have.attr', 'class', 'text-xl font-bold pb-4')
})
})
})

describe('ホームページ(投票期間中)', () => {
beforeEach(() => {
const startSosenkyoDateTime = new Date(
new Date('2022-06-24 21:00:00').toLocaleString('ja-JP')
).getTime()
cy.clock(startSosenkyoDateTime)

cy.visit('/')
})

it('期待どおりの挙動をすること', () => {
cy.url().should('equal', 'http://localhost:3100/')

cy.get('title').should('have.text', 'ホーム - 幻水総選挙2022')

// h1 タグ
cy.get('h1').should('have.length', 8)
cy.get('h1').each((item, index, list) => {
if (index === 0) {
cy.wrap(item).should('have.text', '幻水総選挙って何?')
}

if (index === 6) {
cy.wrap(item).should('have.text', 'お願い')
}
})
cy.contains('h1', //).should('have.length', 1)

// h2 タグ
cy.get('h2').then((div) => {
cy.wrap(div.eq(0)).should('have.attr', 'class', 'text-xl font-bold pb-4')
})
})
})
143 changes: 0 additions & 143 deletions cypress/integration/1-getting-started/todo.spec.ts

This file was deleted.

Loading

0 comments on commit 099f086

Please sign in to comment.