-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from JarvusInnovations/develop
Release: v1.16.0
- Loading branch information
Showing
38 changed files
with
1,585 additions
and
1,357 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: 'Test: End-to-end' | ||
|
||
on: pull_request | ||
|
||
env: | ||
HAB_LICENSE: accept-no-persist | ||
HOLO_CACHE_TO: origin | ||
HOLO_CACHE_FROM: origin | ||
|
||
jobs: | ||
test-e2e: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
# TODO: wrap the next three steps an an emergence-studio action | ||
- name: 'Stop default mysql service' | ||
run: sudo service mysql stop | ||
|
||
- name: 'Initialize Chef Habitat environment' | ||
uses: JarvusInnovations/habitat-action@action/v1 | ||
env: | ||
HAB_NGINX: | | ||
[http.listen] | ||
port = 7080 | ||
HAB_MYSQL: | | ||
app_username = 'appadmin' | ||
app_password = 'appadmin' | ||
bind = '0.0.0.0' | ||
HAB_PHP_RUNTIME: | | ||
[sites.default.holo] | ||
gitDir = '${{ github.workspace }}/.git' | ||
with: | ||
deps: | | ||
jarvus/hologit | ||
supervisor: | | ||
core/mysql | ||
emergence/php-runtime --bind="database:mysql.default" | ||
emergence/nginx --bind="backend:php-runtime.default" | ||
- name: Waiting for MySQL | ||
run: | | ||
until nc -z localhost 3306; do | ||
sleep 0.5 | ||
echo -n "." | ||
done | ||
- name: Waiting for Emergence runtime | ||
run: | | ||
until nc -z localhost 9123; do | ||
sleep 0.5 | ||
echo -n "." | ||
done | ||
- name: Configure command-line client access | ||
run: | | ||
sudo chmod ugo+xr \ | ||
/hab/svc/mysql/config \ | ||
/hab/svc/mysql/config/client.cnf \ | ||
/hab/svc/php-runtime/config \ | ||
/hab/svc/php-runtime/config/fpm-exec | ||
ln -sf /hab/svc/mysql/config/client.cnf ~/.my.cnf | ||
- name: Load site projection into emergence runtime | ||
env: | ||
HOLO_CACHE_FROM: origin | ||
HOLO_CACHE_TO: origin | ||
run: | | ||
SITE_TREE="$(hab pkg exec jarvus/hologit git-holo project emergence-site)" | ||
[ -n "${SITE_TREE}" ] || exit 1 | ||
hab pkg exec emergence/php-runtime emergence-php-load "${SITE_TREE}" | ||
- name: Set up Cypress workspace | ||
run: | | ||
CYPRESS_TREE="$(hab pkg exec jarvus/hologit git-holo project cypress-workspace)" | ||
[ -n "${CYPRESS_TREE}" ] || exit 1 | ||
mkdir "${GITHUB_WORKSPACE}.cypress-workspace" | ||
git archive --format=tar "${CYPRESS_TREE}" | (cd "${GITHUB_WORKSPACE}.cypress-workspace" && tar xf -) | ||
- name: Run Cypress tests | ||
uses: cypress-io/github-action@v2 | ||
env: | ||
GIT_DIR: ${{ github.workspace }}/.git | ||
GIT_WORK_TREE: ${{ github.workspace }} | ||
with: | ||
env: STUDIO_CONTAINER=,STUDIO_SSH= | ||
working-directory: ${{ github.workspace }}.cypress-workspace | ||
|
||
- name: Upload supervisor log | ||
uses: actions/upload-artifact@v1 | ||
if: always() | ||
with: | ||
name: supervisor-log | ||
path: /hab/sup/default/sup.log | ||
|
||
- name: Upload Cypress screenshots | ||
uses: actions/upload-artifact@v1 | ||
if: failure() | ||
with: | ||
name: cypress-screenshots | ||
path: ${{ github.workspace }}.cypress-workspace/cypress/screenshots | ||
|
||
- name: Upload Cypress videos | ||
uses: actions/upload-artifact@v1 | ||
if: always() | ||
with: | ||
name: cypress-videos | ||
path: ${{ github.workspace }}.cypress-workspace/cypress/videos |
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,7 @@ | ||
[holomapping] | ||
files = [ | ||
"cypress/**", | ||
"cypress.json", | ||
"package.json", | ||
"package-lock.json", | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
describe('Blogging', () => { | ||
|
||
// reset database before tests | ||
before(() => { | ||
cy.resetDatabase(); | ||
}); | ||
|
||
it('Create post', () => { | ||
cy.loginAs('user', 'user'); | ||
|
||
cy.visit('/blog'); | ||
|
||
cy.contains('Create a Post').click(); | ||
|
||
cy.get('.x-panel.emergence-cms-editor .x-btn[id^=emergence-cms-toolbar-][id$=-menu-trigger]') | ||
.click(); | ||
|
||
cy.contains('.x-menu-item-text[id^=menuitem-]', 'Publish on save') | ||
.click(); | ||
|
||
cy.contains('.x-menu-item-text[id^=menucheckitem-]', 'Publish on save') | ||
.click(); | ||
|
||
cy.get('input[id^=datefield-]') | ||
.type('{selectall}01/02/2030'); | ||
|
||
cy.get('input[id^=timefield-]') | ||
.type('{selectall}4:05 pm{enter}'); | ||
|
||
cy.get('.x-component.emergence-cms-preview time[data-ref="timeEl"]') | ||
.should('contain', 'Wednesday, January 2, 2030 at 4:05 pm') | ||
.click(); | ||
|
||
cy.get('.x-panel.emergence-cms-editor .x-btn[id^=emergence-cms-toolbar-][id$=-menu-trigger]') | ||
.click(); | ||
|
||
cy.contains('.x-menu-item-text[id^=menuitem-]', '1/2/2030 4:05 pm'); | ||
|
||
cy.get('.x-field.field-title input') | ||
.type('Hello world!') | ||
.tab(); | ||
|
||
cy.focused() | ||
.should('contain', 'Save') | ||
.tab(); | ||
|
||
cy.focused() | ||
.wait(500) | ||
.type('tag1{enter}tag2'); | ||
|
||
cy.get('.x-panel-body .x-field textarea') | ||
.type('## Header 2{enter}{enter}### Header 3{enter}{enter}- point 1{enter}- point2{enter}'); | ||
|
||
cy.contains('.x-btn.save-btn', 'Save') | ||
.click(); | ||
|
||
cy.location('pathname').should('eq', '/blog/hello_world/edit'); | ||
cy.location('search').should('be.empty'); | ||
|
||
cy.get('.x-component.emergence-cms-preview').within(() => { | ||
|
||
cy.get('time[data-ref="timeEl"]') | ||
.should('contain', 'Wednesday, January 2, 2030 at 4:05 pm'); | ||
|
||
cy.get('[data-ref=tagsCt] a') | ||
.should('have.length', 2) | ||
.first() | ||
.should('have.attr', 'href', '/tags/tag1') | ||
.should('have.text', 'tag1') | ||
.next() | ||
.should('have.attr', 'href', '/tags/tag2') | ||
.should('have.text', 'tag2'); | ||
}); | ||
}); | ||
|
||
it('Edit post', () => { | ||
cy.loginAs('user', 'user'); | ||
|
||
cy.visit('/drafts'); | ||
|
||
cy.contains('Hello world!') | ||
.should('have.attr', 'href', '/blog/hello_world') | ||
.click(); | ||
|
||
cy.contains('Edit') | ||
.should('have.attr', 'href', '/blog/hello_world/edit') | ||
.click(); | ||
|
||
cy.get('.x-panel.emergence-cms-editor .x-btn[id^=emergence-cms-toolbar-][id$=-menu-trigger]') | ||
.click(); | ||
|
||
cy.contains('.x-menu-item-text[id^=menuitem-]', '1/2/2030 4:05 pm') | ||
.click(); | ||
|
||
cy.get('input[id^=timefield-]') | ||
.type('{selectall}6:07 pm{enter}'); | ||
|
||
cy.get('.x-component.emergence-cms-preview time[data-ref="timeEl"]') | ||
.should('contain', 'Wednesday, January 2, 2030 at 6:07 pm') | ||
.click(); | ||
|
||
cy.contains('.x-btn.save-btn', 'Save') | ||
.click(); | ||
|
||
cy.reload(); | ||
|
||
cy.get('.x-component.emergence-cms-preview time[data-ref="timeEl"]') | ||
.should('contain', 'Wednesday, January 2, 2030 at 6:07 pm'); | ||
}); | ||
}); |
Oops, something went wrong.