Skip to content

Commit

Permalink
dotenv を devDependencies に移動する
Browse files Browse the repository at this point in the history
テストの名前を英語表記にする
  • Loading branch information
kazuma-naka committed Jan 6, 2025
1 parent eea92ff commit 26b2dd2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
9 changes: 6 additions & 3 deletions e2e/login_then_logout.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { test, expect } from "@playwright/test";
import dotenv from "dotenv";

test.describe("ユーザー認証のテスト", () => {
dotenv.config({ path: ".env.local" });

test.describe("Log IN and Log OUT test", () => {
const validEmail =
process.env.EMAIL ??
(() => {
Expand All @@ -12,7 +15,7 @@ test.describe("ユーザー認証のテスト", () => {
throw new Error("PASSWORD is not defined");
})();

test("有効なユーザー情報でログインし、ログアウトできる", async ({ page }) => {
test("Should Success Login with valid Email and Password then Logout", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.getByRole("link", { name: "ログイン" }).click();

Expand All @@ -36,7 +39,7 @@ test.describe("ユーザー認証のテスト", () => {
await expect(signInButton).toBeVisible();
});

test("無効なユーザー情報でログインに失敗する", async ({ page }) => {
test("Should Fail Login with Invalid Email and Password", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.getByRole("link", { name: "ログイン" }).click();

Expand Down
26 changes: 1 addition & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"e2e": "dotenv -e .env.local playwright test"
"e2e": "playwright test"
},
"dependencies": {
"@heroicons/react": "^2.1.5",
Expand All @@ -31,7 +31,7 @@
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.4.20",
"dotenv-cli": "^8.0.0",
"dotenv": "^16.4.7",
"encoding": "^0.1.13",
"eslint": "^8",
"eslint-config-next": "14.2.5",
Expand Down

0 comments on commit 26b2dd2

Please sign in to comment.