-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
143 changed files
with
3,061 additions
and
1,644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.github | ||
.travis | ||
.vscode | ||
.config | ||
Dockerfile | ||
build/ | ||
built/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: misskey/misskey | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build and Push to Docker Hub | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,189 @@ | ||
describe('Basic', () => { | ||
before(() => { | ||
cy.request('POST', '/api/reset-db'); | ||
}); | ||
|
||
describe('Before setup instance', () => { | ||
beforeEach(() => { | ||
cy.request('POST', '/api/reset-db').as('reset'); | ||
cy.get('@reset').its('status').should('equal', 204); | ||
cy.reload(true); | ||
}); | ||
|
||
afterEach(() => { | ||
// テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。 | ||
// waitを入れることでそれを防止できる | ||
cy.wait(1000); | ||
}); | ||
|
||
it('successfully loads', () => { | ||
cy.visit('/'); | ||
}); | ||
|
||
it('setup instance', () => { | ||
cy.visit('/'); | ||
|
||
cy.intercept('POST', '/api/admin/accounts/create').as('signup'); | ||
|
||
cy.get('[data-cy-admin-username] input').type('admin'); | ||
|
||
cy.get('[data-cy-admin-password] input').type('admin1234'); | ||
|
||
cy.get('[data-cy-admin-ok]').click(); | ||
|
||
// なぜか動かない | ||
//cy.wait('@signup').should('have.property', 'response.statusCode'); | ||
cy.wait('@signup'); | ||
}); | ||
}); | ||
|
||
it('signup', () => { | ||
describe('After setup instance', () => { | ||
beforeEach(() => { | ||
cy.request('POST', '/api/reset-db').as('reset'); | ||
cy.get('@reset').its('status').should('equal', 204); | ||
cy.reload(true); | ||
|
||
// インスタンス初期セットアップ | ||
cy.request('POST', '/api/admin/accounts/create', { | ||
username: 'admin', | ||
password: 'pass', | ||
}).its('body').as('admin'); | ||
|
||
cy.get('@admin'); | ||
}); | ||
|
||
afterEach(() => { | ||
// テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。 | ||
// waitを入れることでそれを防止できる | ||
cy.wait(1000); | ||
}); | ||
|
||
it('successfully loads', () => { | ||
cy.visit('/'); | ||
}); | ||
|
||
cy.get('[data-cy-signup]').click(); | ||
it('signup', () => { | ||
cy.visit('/'); | ||
|
||
cy.get('[data-cy-signup-username] input').type('alice'); | ||
cy.intercept('POST', '/api/signup').as('signup'); | ||
|
||
cy.get('[data-cy-signup]').click(); | ||
cy.get('[data-cy-signup-username] input').type('alice'); | ||
cy.get('[data-cy-signup-password] input').type('alice1234'); | ||
|
||
cy.get('[data-cy-signup-password-retype] input').type('alice1234'); | ||
|
||
cy.get('[data-cy-signup-submit]').click(); | ||
|
||
cy.wait('@signup'); | ||
}); | ||
}); | ||
|
||
it('signin', () => { | ||
describe('After user signup', () => { | ||
beforeEach(() => { | ||
cy.request('POST', '/api/reset-db').as('reset'); | ||
cy.get('@reset').its('status').should('equal', 204); | ||
cy.reload(true); | ||
|
||
// インスタンス初期セットアップ | ||
cy.request('POST', '/api/admin/accounts/create', { | ||
username: 'admin', | ||
password: 'pass', | ||
}).its('body').as('admin'); | ||
|
||
cy.get('@admin').then(() => { | ||
// ユーザー作成 | ||
cy.request('POST', '/api/signup', { | ||
username: 'alice', | ||
password: 'alice1234', | ||
}).its('body').as('alice'); | ||
}); | ||
|
||
cy.get('@alice'); | ||
}); | ||
|
||
afterEach(() => { | ||
// テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。 | ||
// waitを入れることでそれを防止できる | ||
cy.wait(1000); | ||
}); | ||
|
||
it('successfully loads', () => { | ||
cy.visit('/'); | ||
}); | ||
|
||
cy.get('[data-cy-signin]').click(); | ||
it('signin', () => { | ||
cy.visit('/'); | ||
|
||
cy.get('[data-cy-signin-username] input').type('alice'); | ||
cy.intercept('POST', '/api/signin').as('signin'); | ||
|
||
cy.get('[data-cy-signin]').click(); | ||
cy.get('[data-cy-signin-username] input').type('alice'); | ||
// Enterキーでサインインできるかの確認も兼ねる | ||
cy.get('[data-cy-signin-password] input').type('alice1234{enter}'); | ||
|
||
cy.wait('@signin'); | ||
}); | ||
|
||
it('note', () => { | ||
cy.visit('/'); | ||
it('suspend', function() { | ||
cy.request('POST', '/api/admin/suspend-user', { | ||
i: this.admin.token, | ||
userId: this.alice.id, | ||
}); | ||
|
||
//#region TODO: この辺はUI操作ではなくAPI操作でログインする | ||
cy.get('[data-cy-signin]').click(); | ||
cy.visit('/'); | ||
|
||
cy.get('[data-cy-signin]').click(); | ||
cy.get('[data-cy-signin-username] input').type('alice'); | ||
|
||
// Enterキーでサインインできるかの確認も兼ねる | ||
cy.get('[data-cy-signin-password] input').type('alice1234{enter}'); | ||
//#endregion | ||
|
||
cy.get('[data-cy-open-post-form]').click(); | ||
cy.contains('アカウントが凍結されています'); | ||
}); | ||
}); | ||
|
||
cy.get('[data-cy-post-form-text]').type('Hello, Misskey!'); | ||
describe('After user singed in', () => { | ||
beforeEach(() => { | ||
cy.request('POST', '/api/reset-db').as('reset'); | ||
cy.get('@reset').its('status').should('equal', 204); | ||
cy.reload(true); | ||
|
||
// インスタンス初期セットアップ | ||
cy.request('POST', '/api/admin/accounts/create', { | ||
username: 'admin', | ||
password: 'pass', | ||
}).its('body').as('admin'); | ||
|
||
cy.get('@admin').then(() => { | ||
// ユーザー作成 | ||
cy.request('POST', '/api/signup', { | ||
username: 'alice', | ||
password: 'alice1234', | ||
}).its('body').as('alice'); | ||
}); | ||
|
||
cy.get('@alice').then(() => { | ||
cy.visit('/'); | ||
|
||
cy.intercept('POST', '/api/signin').as('signin'); | ||
|
||
cy.get('[data-cy-signin]').click(); | ||
cy.get('[data-cy-signin-username] input').type('alice'); | ||
cy.get('[data-cy-signin-password] input').type('alice1234{enter}'); | ||
|
||
cy.wait('@signin').as('signedIn'); | ||
}); | ||
|
||
cy.get('@signedIn'); | ||
}); | ||
|
||
afterEach(() => { | ||
// テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。 | ||
// waitを入れることでそれを防止できる | ||
cy.wait(1000); | ||
}); | ||
|
||
it('successfully loads', () => { | ||
cy.visit('/'); | ||
}); | ||
|
||
it('note', () => { | ||
cy.visit('/'); | ||
|
||
cy.get('[data-cy-open-post-form]').click(); | ||
cy.get('[data-cy-post-form-text]').type('Hello, Misskey!'); | ||
cy.get('[data-cy-open-post-form-submit]').click(); | ||
|
||
// TODO: 投稿した文字列が画面内にあるか(=タイムラインに流れてきたか)のテスト | ||
cy.contains('Hello, Misskey!'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.