Merge pull request #19132 from MauricioFauth/table-create-e2e-test-fix

Fix failing E2E tests
This commit is contained in:
Maurício Meneghini Fauth 2024-04-26 20:08:48 -03:00 committed by GitHub
commit de9a89efbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 34 additions and 39 deletions

View File

@ -145,11 +145,11 @@ class EventsTest extends TestBase
sleep(2);
$this->dbQuery(
'SELECT val FROM `' . $this->databaseName . '`.`test_table`',
'SELECT * FROM `' . $this->databaseName . '`.`test_table`',
function (): void {
$this->assertTrue($this->isElementPresent('className', 'table_results'));
$this->scrollToElement($this->waitForElement('className', 'table_results'), 0, 20);
// [ ] | Edit | Copy | Delete | 1 | <number>
$this->assertGreaterThan(2, (int) $this->getCellByTableClass('table_results', 1, 5));
$this->assertGreaterThan(2, (int) $this->getCellByTableClass('table_results', 1, 6));
}
);
}
@ -183,11 +183,11 @@ class EventsTest extends TestBase
sleep(2);
$this->dbQuery(
'SELECT val FROM `' . $this->databaseName . '`.`test_table`',
'SELECT * FROM `' . $this->databaseName . '`.`test_table`',
function (): void {
$this->assertTrue($this->isElementPresent('className', 'table_results'));
$this->scrollToElement($this->waitForElement('className', 'table_results'), 0, 20);
// [ ] | Edit | Copy | Delete | 4
$this->assertGreaterThan(3, (int) $this->getCellByTableClass('table_results', 1, 5));
$this->assertGreaterThan(3, (int) $this->getCellByTableClass('table_results', 1, 6));
}
);
}

View File

@ -119,56 +119,56 @@ class QueryByExampleTest extends TestBase
$submitButton->click();
$this->waitAjax();
$this->waitForElement('cssSelector', 'table.table_results');
$this->scrollToElement($this->waitForElement('className', 'table_results'), 0, 20);
/* Assert Row 1 */
$this->assertEquals(
4,
$this->getCellByTableClass('table_results', 1, 5)
$this->getCellByTableClass('table_results', 1, 1)
);
$this->assertEquals(
3,
$this->getCellByTableClass('table_results', 1, 6)
$this->getCellByTableClass('table_results', 1, 2)
);
/* Assert Row 2 */
$this->assertEquals(
6,
$this->getCellByTableClass('table_results', 2, 5)
$this->getCellByTableClass('table_results', 2, 1)
);
$this->assertEquals(
4,
$this->getCellByTableClass('table_results', 2, 6)
$this->getCellByTableClass('table_results', 2, 2)
);
/* Assert Row 3 */
$this->assertEquals(
5,
$this->getCellByTableClass('table_results', 3, 5)
$this->getCellByTableClass('table_results', 3, 1)
);
$this->assertEquals(
4,
$this->getCellByTableClass('table_results', 3, 6)
$this->getCellByTableClass('table_results', 3, 2)
);
/* Assert Row 4 */
$this->assertEquals(
7,
$this->getCellByTableClass('table_results', 4, 5)
$this->getCellByTableClass('table_results', 4, 1)
);
$this->assertEquals(
5,
$this->getCellByTableClass('table_results', 4, 6)
$this->getCellByTableClass('table_results', 4, 2)
);
/* Assert Row 5 */
$this->assertEquals(
3,
$this->getCellByTableClass('table_results', 5, 5)
$this->getCellByTableClass('table_results', 5, 1)
);
$this->assertEquals(
5,
$this->getCellByTableClass('table_results', 5, 6)
$this->getCellByTableClass('table_results', 5, 2)
);
}
}

View File

@ -117,11 +117,11 @@ class TriggersTest extends TestBase
// test trigger
$this->dbQuery('USE `' . $this->databaseName . '`;INSERT INTO `test_table` (val) VALUES (1);');
$this->dbQuery(
'SELECT val FROM `' . $this->databaseName . '`.`test_table2`;',
'SELECT * FROM `' . $this->databaseName . '`.`test_table2`;',
function (): void {
$this->assertTrue($this->isElementPresent('className', 'table_results'));
$this->scrollToElement($this->waitForElement('className', 'table_results'), 0, 20);
// [ ] | Edit | Copy | Delete | 1 | 3
$this->assertEquals('3', $this->getCellByTableClass('table_results', 1, 5));
$this->assertEquals('3', $this->getCellByTableClass('table_results', 1, 6));
}
);
}
@ -157,11 +157,11 @@ class TriggersTest extends TestBase
// test trigger
$this->dbQuery('USE `' . $this->databaseName . '`;INSERT INTO `test_table` (val) VALUES (1);');
$this->dbQuery(
'SELECT val FROM `' . $this->databaseName . '`.`test_table2`;',
'SELECT * FROM `' . $this->databaseName . '`.`test_table2`;',
function (): void {
$this->assertTrue($this->isElementPresent('className', 'table_results'));
$this->scrollToElement($this->waitForElement('className', 'table_results'), 0, 20);
// [ ] | Edit | Copy | Delete | 1 | 12
$this->assertEquals('12', $this->getCellByTableClass('table_results', 1, 5));
$this->assertEquals('12', $this->getCellByTableClass('table_results', 1, 6));
}
);
}
@ -189,11 +189,11 @@ class TriggersTest extends TestBase
// test trigger
$this->dbQuery('USE `' . $this->databaseName . '`;INSERT INTO `test_table` (val) VALUES (1);');
$this->dbQuery(
'SELECT val FROM `' . $this->databaseName . '`.`test_table2`;',
'SELECT * FROM `' . $this->databaseName . '`.`test_table2`;',
function (): void {
$this->assertTrue($this->isElementPresent('className', 'table_results'));
$this->scrollToElement($this->waitForElement('className', 'table_results'), 0, 20);
// [ ] | Edit | Copy | Delete | 1 | 2
$this->assertEquals('2', $this->getCellByTableClass('table_results', 1, 5));
$this->assertEquals('2', $this->getCellByTableClass('table_results', 1, 6));
}
);

View File

@ -138,13 +138,10 @@ class CreateTest extends TestBase
$this->getCellByTableId('tablestructure', 1, 10)
);
$this->assertFalse(
$this->isElementPresent(
'cssSelector',
'table#tablestructure tbody tr:nth-child(1) "
. "ul.table-structure-actions li.primary a'
)
);
self::assertFalse($this->isElementPresent(
'cssSelector',
'table#tablestructure tbody tr:nth-child(1) ul li.primary a'
));
// make assertions for second row
$this->assertStringContainsString(
@ -172,11 +169,9 @@ class CreateTest extends TestBase
$this->getCellByTableId('tablestructure', 2, 8)
);
$this->assertFalse(
$this->isElementPresent(
'cssSelector',
'css=ul.table-structure-actions:nth-child(2) li.primary a'
)
);
self::assertTrue($this->isElementPresent(
'cssSelector',
'table#tablestructure tbody tr:nth-child(2) ul li.primary a'
));
}
}