-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional Tests : BO - Stocks - Movements - Filter by category, move…
…ment type, employee and period
- Loading branch information
Showing
14 changed files
with
1,085 additions
and
8,068 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
628 changes: 628 additions & 0 deletions
628
tests/UI/campaigns/functional/BO/03_catalog/08_stocks/01_movements/01_filterMovements.ts
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
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,53 @@ | ||
// Import utils | ||
import testContext from '@utils/testContext'; | ||
|
||
import {expect} from 'chai'; | ||
import {createPool} from 'mariadb'; | ||
import type {Pool, PoolConnection} from 'mariadb'; | ||
|
||
let dbPool: Pool; | ||
let dbConnection: PoolConnection; | ||
|
||
/** | ||
* Function to clean all Stock Movements | ||
* @param baseContext {string} String to identify the test | ||
*/ | ||
function cleanTableStockMovements(baseContext: string = 'commonTests-cleanTableStockMovements'): void { | ||
const dbPrefix: string = global.INSTALL.DB_PREFIX; | ||
|
||
describe(`Clean table ${dbPrefix}stock_mvt`, async () => { | ||
// before and after functions | ||
before(async () => { | ||
dbPool = createPool({ | ||
user: global.INSTALL.DB_USER, | ||
password: global.INSTALL.DB_PASSWD, | ||
host: global.INSTALL.DB_SERVER, | ||
port: 3306, | ||
database: global.INSTALL.DB_NAME, | ||
connectionLimit: 5, | ||
}); | ||
|
||
if (!global.GENERATE_FAILED_STEPS) { | ||
dbConnection = await dbPool.getConnection(); | ||
} | ||
}); | ||
|
||
after(async () => { | ||
if (dbConnection) { | ||
await dbConnection.release(); | ||
} | ||
await dbPool.end(); | ||
}); | ||
|
||
it(`should remove all lines in ${dbPrefix}stock_mvt`, async function () { | ||
await testContext.addContextItem(this, 'testIdentifier', 'truncateTable', baseContext); | ||
|
||
await dbConnection.query(`TRUNCATE TABLE ${dbPrefix}stock_mvt`); | ||
|
||
const rows = await dbConnection.query(`SELECT * FROM ${dbPrefix}stock_mvt`); | ||
expect(rows.length).to.be.equal(0); | ||
}); | ||
}); | ||
} | ||
|
||
export default cleanTableStockMovements; |
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.