mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.4 KiB
79 lines
2.4 KiB
3 years ago
|
|
||
|
import { loginPage } from "../../support/page_objects/navigation"
|
||
|
|
||
3 years ago
|
const genTest = (type) => {
|
||
|
|
||
|
describe(`${type.toUpperCase()} api - Table Row`, () => {
|
||
|
const randVal = 'Test' + Date.now();
|
||
|
const updatedRandVal = 'Updated' + Date.now();
|
||
3 years ago
|
const name = 'Tablerow' + Date.now();
|
||
3 years ago
|
|
||
|
before(() => {
|
||
3 years ago
|
loginPage.loginAndOpenProject(type)
|
||
3 years ago
|
cy.createTable(name)
|
||
|
});
|
||
|
|
||
|
// delete table
|
||
|
after(() => {
|
||
|
cy.deleteTable(name)
|
||
|
});
|
||
|
|
||
|
it('Add new row', () => {
|
||
3 years ago
|
cy.get('.nc-add-new-row-btn').click({force: true});
|
||
3 years ago
|
cy.get('#data-table-form-Title > input').first().type(randVal);
|
||
3 years ago
|
cy.contains('Save Row').filter('button').click({force: true})
|
||
3 years ago
|
cy.get('td', {timeout: 10000}).contains(randVal).should('exist');
|
||
3 years ago
|
})
|
||
|
|
||
|
it('Update row', () => {
|
||
|
cy.get('td').contains(randVal)
|
||
|
.closest('tr')
|
||
|
.find('.nc-row-expand-icon')
|
||
3 years ago
|
.click({force: true});
|
||
3 years ago
|
|
||
|
cy.get('#data-table-form-Title > input').first().clear().type(updatedRandVal);
|
||
3 years ago
|
cy.contains('Save Row').filter('button').click({force: true})
|
||
3 years ago
|
|
||
3 years ago
|
cy.wait(3000)
|
||
3 years ago
|
cy.get('td').contains(randVal).should('not.exist');
|
||
3 years ago
|
cy.get('td').contains(updatedRandVal).should('exist');
|
||
3 years ago
|
})
|
||
|
|
||
|
it('Delete row', () => {
|
||
3 years ago
|
cy.get('td').contains(updatedRandVal).rightclick({force: true})
|
||
3 years ago
|
|
||
|
// delete row
|
||
3 years ago
|
cy.getActiveMenu().find('.v-list-item:contains("Delete Row")').first().click({force: true})
|
||
3 years ago
|
cy.wait(1000)
|
||
|
cy.get('td').contains(randVal).should('not.exist');
|
||
|
})
|
||
|
});
|
||
|
}
|
||
|
|
||
|
genTest('rest')
|
||
|
genTest('graphql')
|
||
|
|
||
3 years ago
|
/**
|
||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd
|
||
|
*
|
||
|
* @author Pranav C Balan <pranavxc@gmail.com>
|
||
|
* @author Raju Udava <sivadstala@gmail.com>
|
||
|
*
|
||
|
* @license GNU AGPL version 3 or any later version
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU Affero General Public License as
|
||
|
* published by the Free Software Foundation, either version 3 of the
|
||
|
* License, or (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU Affero General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Affero General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
*/
|
||
|
|