mirror of
https://github.com/johndoe6345789/postgres.git
synced 2026-04-24 13:55:00 +00:00
Address code review feedback - improve import consistency and screenshot uniqueness
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -12,10 +12,7 @@ import {
|
||||
MenuItem,
|
||||
Select,
|
||||
} from '../atoms';
|
||||
import Button from '../atoms/Button';
|
||||
import TextField from '../atoms/TextField';
|
||||
import Typography from '../atoms/Typography';
|
||||
import IconButton from '../atoms/IconButton';
|
||||
import { Button, TextField, Typography, IconButton } from '../atoms';
|
||||
|
||||
type Column = {
|
||||
name: string;
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
TableRow,
|
||||
Tooltip,
|
||||
} from '../atoms';
|
||||
import IconButton from '../atoms/IconButton';
|
||||
import { IconButton } from '../atoms';
|
||||
|
||||
type DataGridProps = {
|
||||
columns: Array<{ name: string; label?: string }>;
|
||||
|
||||
@@ -9,8 +9,7 @@ import {
|
||||
MenuItem,
|
||||
Select,
|
||||
} from '../atoms';
|
||||
import Button from '../atoms/Button';
|
||||
import Typography from '../atoms/Typography';
|
||||
import { Button, Typography } from '../atoms';
|
||||
|
||||
type DropTableDialogProps = {
|
||||
open: boolean;
|
||||
|
||||
@@ -66,10 +66,20 @@ export async function executeStep(page: Page, step: PlaywrightStep, variables: R
|
||||
break;
|
||||
|
||||
case 'screenshot':
|
||||
// Generate unique filename with timestamp and random component
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(2, 8);
|
||||
const uniqueId = `${timestamp}-${random}`;
|
||||
|
||||
if (selector) {
|
||||
await page.locator(selector).screenshot({ path: `screenshots/${Date.now()}-${selector.replace(/[^a-z0-9]/gi, '_')}.png` });
|
||||
const safeSelector = selector.replace(/[^a-z0-9]/gi, '_');
|
||||
await page.locator(selector).screenshot({
|
||||
path: `screenshots/${uniqueId}-${safeSelector}.png`
|
||||
});
|
||||
} else {
|
||||
await page.screenshot({ path: `screenshots/${Date.now()}-page.png` });
|
||||
await page.screenshot({
|
||||
path: `screenshots/${uniqueId}-page.png`
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user