forked from frappe/erpnext
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/frappe/erpnext into camp…
…aign-module
- Loading branch information
Showing
255 changed files
with
8,471 additions
and
3,307 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
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 |
---|---|---|
@@ -1,16 +1,25 @@ | ||
name: Backport | ||
on: | ||
pull_request: | ||
pull_request_target: | ||
types: | ||
- closed | ||
- labeled | ||
|
||
jobs: | ||
backport: | ||
runs-on: ubuntu-18.04 | ||
name: Backport | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Backport | ||
uses: tibdex/backport@v1 | ||
- name: Checkout Actions | ||
uses: actions/checkout@v2 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: "ankush/backport" | ||
path: ./actions | ||
ref: develop | ||
- name: Install Actions | ||
run: npm install --production --prefix ./actions | ||
- name: Run backport | ||
uses: ./actions/backport | ||
with: | ||
token: ${{secrets.BACKPORT_BOT_TOKEN}} | ||
labelsToAdd: "backport" | ||
title: "{{originalTitle}}" |
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,34 +1,18 @@ | ||
name: Semgrep | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- version-13-hotfix | ||
- version-13-pre-release | ||
pull_request: { } | ||
|
||
jobs: | ||
semgrep: | ||
name: Frappe Linter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup python3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Setup semgrep | ||
run: | | ||
python -m pip install -q semgrep | ||
git fetch origin $GITHUB_BASE_REF:$GITHUB_BASE_REF -q | ||
- name: Semgrep errors | ||
run: | | ||
files=$(git diff --name-only --diff-filter=d $GITHUB_BASE_REF) | ||
[[ -d .github/helper/semgrep_rules ]] && semgrep --severity ERROR --config=.github/helper/semgrep_rules --quiet --error $files | ||
semgrep --config="r/python.lang.correctness" --quiet --error $files | ||
- name: Semgrep warnings | ||
run: | | ||
files=$(git diff --name-only --diff-filter=d $GITHUB_BASE_REF) | ||
[[ -d .github/helper/semgrep_rules ]] && semgrep --severity WARNING --severity INFO --config=.github/helper/semgrep_rules --quiet $files | ||
- uses: actions/checkout@v2 | ||
- uses: returntocorp/semgrep-action@v1 | ||
env: | ||
SEMGREP_TIMEOUT: 120 | ||
with: | ||
config: >- | ||
r/python.lang.correctness | ||
.github/helper/semgrep_rules |
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,108 @@ | ||
name: UI | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-18.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
name: UI Tests (Cypress) | ||
|
||
services: | ||
mysql: | ||
image: mariadb:10.3 | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: YES | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | ||
|
||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
check-latest: true | ||
|
||
- name: Add to Hosts | ||
run: | | ||
echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
${{ runner.os }}- | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Cache cypress binary | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache | ||
key: ${{ runner.os }}-cypress- | ||
restore-keys: | | ||
${{ runner.os }}-cypress- | ||
${{ runner.os }}- | ||
- name: Install | ||
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh | ||
env: | ||
DB: mariadb | ||
TYPE: ui | ||
|
||
- name: Site Setup | ||
run: cd ~/frappe-bench/ && bench --site test_site execute erpnext.setup.utils.before_tests | ||
|
||
- name: cypress pre-requisites | ||
run: cd ~/frappe-bench/apps/frappe && yarn add cypress-file-upload@^5 --no-lockfile | ||
|
||
|
||
- name: Build Assets | ||
run: cd ~/frappe-bench/ && bench build | ||
|
||
- name: UI Tests | ||
run: cd ~/frappe-bench/ && bench --site test_site run-ui-tests erpnext --headless | ||
env: | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
|
||
- name: Show bench console if tests failed | ||
if: ${{ failure() }} | ||
run: cat ~/frappe-bench/bench_run_logs.txt |
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 |
---|---|---|
|
@@ -16,3 +16,4 @@ __pycache__ | |
.idea/ | ||
.vscode/ | ||
node_modules/ | ||
.backportrc.json |
Validating CODEOWNERS rules …
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,11 @@ | ||
{ | ||
"baseUrl": "http://test_site:8000/", | ||
"projectId": "da59y9", | ||
"adminPassword": "admin", | ||
"defaultCommandTimeout": 20000, | ||
"pageLoadTimeout": 15000, | ||
"retries": { | ||
"runMode": 2, | ||
"openMode": 2 | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "hello@cypress.io", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
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,13 @@ | ||
|
||
context('Customer', () => { | ||
before(() => { | ||
cy.login(); | ||
}); | ||
it('Check Customer Group', () => { | ||
cy.visit(`app/customer/`); | ||
cy.get('.primary-action').click(); | ||
cy.wait(500); | ||
cy.get('.custom-actions > .btn').click(); | ||
cy.get_field('customer_group', 'Link').should('have.value', 'All Customer Groups'); | ||
}); | ||
}); |
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,44 @@ | ||
describe("Test Item Dashboard", () => { | ||
before(() => { | ||
cy.login(); | ||
cy.visit("/app/item"); | ||
cy.insert_doc( | ||
"Item", | ||
{ | ||
item_code: "e2e_test_item", | ||
item_group: "All Item Groups", | ||
opening_stock: 42, | ||
valuation_rate: 100, | ||
}, | ||
true | ||
); | ||
cy.go_to_doc("item", "e2e_test_item"); | ||
}); | ||
|
||
it("should show dashboard with correct data on first load", () => { | ||
cy.get(".stock-levels").contains("Stock Levels").should("be.visible"); | ||
cy.get(".stock-levels").contains("e2e_test_item").should("exist"); | ||
|
||
// reserved and available qty | ||
cy.get(".stock-levels .inline-graph-count") | ||
.eq(0) | ||
.contains("0") | ||
.should("exist"); | ||
cy.get(".stock-levels .inline-graph-count") | ||
.eq(1) | ||
.contains("42") | ||
.should("exist"); | ||
}); | ||
|
||
it("should persist on field change", () => { | ||
cy.get('input[data-fieldname="disabled"]').check(); | ||
cy.wait(500); | ||
cy.get(".stock-levels").contains("Stock Levels").should("be.visible"); | ||
cy.get(".stock-levels").should("have.length", 1); | ||
}); | ||
|
||
it("should persist on reload", () => { | ||
cy.reload(); | ||
cy.get(".stock-levels").contains("Stock Levels").should("be.visible"); | ||
}); | ||
}); |
Oops, something went wrong.