- Implemented VisualAITester class for automated UI/UX testing - Configured environment variables for API keys and paths - Developed methods for browser setup, login, screenshot capture, and image encoding - Integrated OpenAI Vision API for visual quality analysis with detailed feedback - Created tests for various application pages including homepage, project flow, geometry form, and more - Generated comprehensive HTML report summarizing test results and AI analysis - Added functionality to copy AI prompts for automated issue resolution
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
import { useSnackbar } from 'notistack';
|
|
|
|
/**
|
|
* Custom hook for displaying notifications
|
|
* Replaces window.alert() with better UX
|
|
*/
|
|
export const useNotification = () => {
|
|
const { enqueueSnackbar } = useSnackbar();
|
|
|
|
const notify = {
|
|
success: (message) => {
|
|
enqueueSnackbar(message, {
|
|
variant: 'success',
|
|
autoHideDuration: 3000,
|
|
anchorOrigin: { vertical: 'top', horizontal: 'right' }
|
|
});
|
|
},
|
|
|
|
error: (message) => {
|
|
enqueueSnackbar(message, {
|
|
variant: 'error',
|
|
autoHideDuration: 5000,
|
|
anchorOrigin: { vertical: 'top', horizontal: 'right' }
|
|
});
|
|
},
|
|
|
|
warning: (message) => {
|
|
enqueueSnackbar(message, {
|
|
variant: 'warning',
|
|
autoHideDuration: 4000,
|
|
anchorOrigin: { vertical: 'top', horizontal: 'right' }
|
|
});
|
|
},
|
|
|
|
info: (message) => {
|
|
enqueueSnackbar(message, {
|
|
variant: 'info',
|
|
autoHideDuration: 3000,
|
|
anchorOrigin: { vertical: 'top', horizontal: 'right' }
|
|
});
|
|
}
|
|
};
|
|
|
|
return notify;
|
|
};
|